Lines Matching refs:ptr
57 void put_uint32(const uint32_t l, char **ptr) in put_uint32() argument
59 (*ptr)[0] = (char)((l >> 24) & 0xFF); in put_uint32()
60 (*ptr)[1] = (char)((l >> 16) & 0xFF); in put_uint32()
61 (*ptr)[2] = (char)((l >> 8) & 0xFF); in put_uint32()
62 (*ptr)[3] = (char)((l ) & 0xFF); in put_uint32()
63 *ptr += sizeof(uint32_t); in put_uint32()
66 uint32_t get_uint32(const char **ptr, const char *end) in get_uint32() argument
68 if (!*ptr || *ptr + sizeof(uint32_t) > end) in get_uint32()
70 *ptr = NULL; in get_uint32()
75 uint8_t *p = (uint8_t*) *ptr; in get_uint32()
76 *ptr += sizeof(uint32_t); in get_uint32()
81 void put_uint16(uint16_t s, char **ptr) in put_uint16() argument
83 (*ptr)[0] = (char)((s >> 8) & 0xFF); in put_uint16()
84 (*ptr)[1] = (char)((s ) & 0xFF); in put_uint16()
85 *ptr += sizeof(uint16_t); in put_uint16()
88 uint16_t get_uint16(const char **ptr, const char *end) in get_uint16() argument
90 if (!*ptr || *ptr + sizeof(uint16_t) > end) in get_uint16()
92 *ptr = NULL; in get_uint16()
97 uint8_t *p = (uint8_t*) *ptr; in get_uint16()
98 *ptr += sizeof(uint16_t); in get_uint16()
103 int put_string(const char *str, char **ptr) in put_string() argument
106 strcpy(*ptr, str); in put_string()
107 *ptr += strlen(str) + 1; in put_string()
111 int get_string(const char **ptr, const char *const end, char *buffer, int buflen) in get_string() argument
113 if (!*ptr) in get_string()
121 while (*ptr < end && buffer < lim) in get_string()
123 char c = *buffer++ = *(*ptr)++; in get_string()
128 *ptr = NULL; // clear pointer, in get_string()
133 void put_rdata(const int rdlen, const unsigned char *rdata, char **ptr) in put_rdata() argument
135 memcpy(*ptr, rdata, rdlen); in put_rdata()
136 *ptr += rdlen; in put_rdata()
139 const char *get_rdata(const char **ptr, const char *end, int rdlen) in get_rdata() argument
141 if (!*ptr || *ptr + rdlen > end) in get_rdata()
143 *ptr = NULL; in get_rdata()
148 const char *rd = *ptr; in get_rdata()
149 *ptr += rdlen; in get_rdata()