Rizin
unix-like reverse engineering framework and cli tools
sdb_private.h File Reference

Go to the source code of this file.

Macros

#define HAVE_HEADER_SYS_MMAN_H   HAVE_MMAN
 
#define SDB_V_NOT(op, fail_ret)
 
#define write_(fd, buf, count)   SDB_V_NOT(write(fd, buf, count), -1)
 
#define read_(fd, buf, count)   SDB_V_NOT(read(fd, buf, count), -1)
 

Functions

static int seek_set (int fd, off_t pos)
 
static void ut32_pack (char s[4], ut32 u)
 
static void ut32_pack_big (char s[4], ut32 u)
 
static void ut32_unpack (char s[4], ut32 *u)
 

Macro Definition Documentation

◆ HAVE_HEADER_SYS_MMAN_H

#define HAVE_HEADER_SYS_MMAN_H   HAVE_MMAN

Definition at line 12 of file sdb_private.h.

◆ read_

#define read_ (   fd,
  buf,
  count 
)    SDB_V_NOT(read(fd, buf, count), -1)

Definition at line 19 of file sdb_private.h.

◆ SDB_V_NOT

#define SDB_V_NOT (   op,
  fail_ret 
)
Value:
if ((op) == (fail_ret)) \
eprintf(#op " at %s:%d failed: %s\n", __FILE__, __LINE__, strerror(errno))
Definition: dis.c:32

Definition at line 15 of file sdb_private.h.

◆ write_

#define write_ (   fd,
  buf,
  count 
)    SDB_V_NOT(write(fd, buf, count), -1)

Definition at line 18 of file sdb_private.h.

Function Documentation

◆ seek_set()

static int seek_set ( int  fd,
off_t  pos 
)
inlinestatic

Definition at line 21 of file sdb_private.h.

21  {
22  return ((fd == -1) || (lseek(fd, (off_t)pos, SEEK_SET) == -1)) ? 0 : 1;
23 }
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep lseek
Definition: sflib.h:113
int off_t
Definition: sftypes.h:41
int pos
Definition: main.c:11
static const z80_opcode fd[]
Definition: z80_tab.h:997
#define SEEK_SET
Definition: zip.c:88

References fd, lseek, pos, and SEEK_SET.

Referenced by cdb_make_finish(), cdb_make_start(), cdb_read(), and sdb_dump_begin().

◆ ut32_pack()

static void ut32_pack ( char  s[4],
ut32  u 
)
inlinestatic

Definition at line 25 of file sdb_private.h.

25  {
26  s[0] = u & 255;
27  u >>= 8;
28  s[1] = u & 255;
29  u >>= 8;
30  s[2] = u & 255;
31  s[3] = u >> 8;
32 }
static RzSocket * s
Definition: rtr.c:28

References s.

Referenced by cdb_make_finish().

◆ ut32_pack_big()

static void ut32_pack_big ( char  s[4],
ut32  u 
)
inlinestatic

Definition at line 34 of file sdb_private.h.

34  {
35  s[3] = u & 255;
36  u >>= 8;
37  s[2] = u & 255;
38  u >>= 8;
39  s[1] = u & 255;
40  s[0] = u >> 8;
41 }

References s.

◆ ut32_unpack()

static void ut32_unpack ( char  s[4],
ut32 u 
)
inlinestatic

Definition at line 43 of file sdb_private.h.

43  {
44  ut32 result = 0;
45  result = (ut8)s[3];
46  result <<= 8;
47  result += (ut8)s[2];
48  result <<= 8;
49  result += (ut8)s[1];
50  result <<= 8;
51  result += (ut8)s[0];
52  *u = result;
53 }
#define ut8
Definition: dcpu16.h:8
uint32_t ut32

References s, and ut8.

Referenced by cdb_findnext().