| /netbsd-src/usr.sbin/sdpd/ |
| H A D | compat.c | 57 dun_profile(sdp_data_t *buf, void *arg, ssize_t len) in dun_profile() argument 60 uint8_t *first = buf->next; in dun_profile() 67 sdp_put_uint16(buf, SDP_ATTR_SERVICE_RECORD_HANDLE); in dun_profile() 68 sdp_put_uint32(buf, 0x00000000); in dun_profile() 70 sdp_put_uint16(buf, SDP_ATTR_SERVICE_CLASS_ID_LIST); in dun_profile() 71 sdp_put_seq(buf, 3); in dun_profile() 72 sdp_put_uuid16(buf, SDP_SERVICE_CLASS_DIALUP_NETWORKING); in dun_profile() 74 sdp_put_uint16(buf, SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST); in dun_profile() 75 sdp_put_seq(buf, 12); in dun_profile() 76 sdp_put_seq(buf, 3); in dun_profile() [all …]
|
| /netbsd-src/sys/arch/ia64/unwind/ |
| H A D | decode.c | 19 unwind_decode_ule128(char *buf, unsigned long *val) in unwind_decode_ule128() argument 25 val[0] += ((buf[i] & 0x7f) << (i * 7)); in unwind_decode_ule128() 27 }while((0x80 & buf[i++]) && (i < 9)); in unwind_decode_ule128() 34 buf+= i; in unwind_decode_ule128() 35 return buf; in unwind_decode_ule128() 40 unwind_decode_R1(char *buf, union unwind_desc *uwd) in unwind_decode_R1() argument 43 if(!IS_R1(buf[0])) return NULL; in unwind_decode_R1() 44 uwd->R1.r = ((buf[0] & 0x20) == 0x20); in unwind_decode_R1() 45 uwd->R1.rlen = (buf[0] & 0x1f); in unwind_decode_R1() 46 buf++; in unwind_decode_R1() [all …]
|
| /netbsd-src/external/mpl/bind/dist/tests/isc/ |
| H A D | time_test.c | 144 char buf[ISC_FORMATHTTPTIMESTAMP_SIZE]; in ISC_RUN_TEST_IMPL() local 151 isc_time_formathttptimestamp(&t, buf, sizeof(buf)); in ISC_RUN_TEST_IMPL() 152 result = isc_time_parsehttptimestamp(buf, &x); in ISC_RUN_TEST_IMPL() 161 char buf[64]; in ISC_RUN_TEST_IMPL() 169 memset(buf, 'X', sizeof(buf)); in ISC_RUN_TEST_IMPL() 170 isc_time_formatISO8601(&t, buf, sizeof(buf)); in ISC_RUN_TEST_IMPL() 171 assert_int_equal(strlen(buf), 2 in ISC_RUN_TEST_IMPL() 163 char buf[64]; ISC_RUN_TEST_IMPL() local 199 char buf[64]; ISC_RUN_TEST_IMPL() local 236 char buf[64]; ISC_RUN_TEST_IMPL() local 273 char buf[64]; ISC_RUN_TEST_IMPL() local 308 char buf[64]; ISC_RUN_TEST_IMPL() local 344 char buf[64]; ISC_RUN_TEST_IMPL() local 380 char buf[64]; ISC_RUN_TEST_IMPL() local [all...] |
| /netbsd-src/sys/dev/i2c/ |
| H A D | nxt2k.c | 110 uint8_t attr, len2, buf; in nxt2k_writereg() local 123 buf = 0x80; in nxt2k_writereg() 127 nxt2k_writedata(nxt, 0x21, &buf, 1); in nxt2k_writereg() 129 nxt2k_readdata(nxt, 0x21, &buf, 1); in nxt2k_writereg() 131 if (buf == 0) in nxt2k_writereg() 140 uint8_t buf, len2, attr; in nxt2k_readreg() local 155 buf = 0x80; in nxt2k_readreg() 156 nxt2k_writedata(nxt, 0x21, &buf, 1); in nxt2k_readreg() 181 uint8_t stopval, buf; in nxt2k_mc_stop() local 186 buf = 0x80; in nxt2k_mc_stop() [all …]
|
| /netbsd-src/external/bsd/tmux/dist/compat/ |
| H A D | imsg-buffer.c | 56 struct ibuf *buf; in ibuf_open() local 62 if ((buf = calloc(1, sizeof(struct ibuf))) == NULL) in ibuf_open() 64 if ((buf->buf = calloc(len, 1)) == NULL) { in ibuf_open() 65 free(buf); in ibuf_open() 68 buf->size = buf->max = len; in ibuf_open() 69 buf->fd = -1; in ibuf_open() 71 return (buf); in ibuf_open() 77 struct ibuf *buf; in ibuf_dynamic() local 84 if ((buf = calloc(1, sizeof(struct ibuf))) == NULL) in ibuf_dynamic() 87 if ((buf->buf = calloc(len, 1)) == NULL) { in ibuf_dynamic() [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/gcc/d/dmd/ |
| H A D | hdrgen.d | 76 OutBuffer buf; in genhdrfile() local 77 buf.doindent = 1; in genhdrfile() 78 buf.printf("// D import file generated from '%s'", m.srcfile.toChars()); in genhdrfile() 79 buf.writenl(); in genhdrfile() 82 toCBuffer(m, &buf, &hgs); in genhdrfile() 83 writeFile(m.loc, m.hdrfile.toString(), buf[]); in genhdrfile() 92 extern (C++) void moduleToBuffer(OutBuffer* buf, Module m) in moduleToBuffer() argument 96 toCBuffer(m, buf, &hgs); in moduleToBuffer() 99 void moduleToBuffer2(Module m, OutBuffer* buf, HdrGenState* hgs) in moduleToBuffer2() argument 105 buf.writestring("@("); in moduleToBuffer2() [all …]
|
| /netbsd-src/external/gpl3/gcc.old/dist/gcc/d/dmd/ |
| H A D | hdrgen.c | 44 void linkageToBuffer(OutBuffer *buf, LINK linkage); 45 void MODtoBuffer(OutBuffer *buf, MOD mod); 49 OutBuffer buf; in genhdrfile() local 50 buf.doindent = 1; in genhdrfile() 52 buf.printf("// D import file generated from '%s'", m->srcfile->toChars()); in genhdrfile() 53 buf.writenl(); in genhdrfile() 58 toCBuffer(m, &buf, &hgs); in genhdrfile() 61 m->hdrfile->setbuffer(buf.data, buf.offset); in genhdrfile() 62 buf.extractData(); in genhdrfile() 74 void moduleToBuffer(OutBuffer *buf, Module *m) in moduleToBuffer() argument [all …]
|
| /netbsd-src/external/gpl3/gcc.old/dist/libiberty/ |
| H A D | simple-object-common.h | 189 simple_object_fetch_big_16 (const unsigned char *buf) in simple_object_fetch_big_16() argument 191 return ((unsigned short) buf[0] << 8) | (unsigned short) buf[1]; in simple_object_fetch_big_16() 197 simple_object_fetch_little_16 (const unsigned char *buf) in simple_object_fetch_little_16() argument 199 return ((unsigned short) buf[1] << 8) | (unsigned short) buf[0]; in simple_object_fetch_little_16() 205 simple_object_fetch_big_32 (const unsigned char *buf) in simple_object_fetch_big_32() argument 207 return (((unsigned int) buf[0] << 24) in simple_object_fetch_big_32() 208 | ((unsigned int) buf[1] << 16) in simple_object_fetch_big_32() 209 | ((unsigned int) buf[2] << 8) in simple_object_fetch_big_32() 210 | (unsigned int) buf[3]); in simple_object_fetch_big_32() 216 simple_object_fetch_little_32 (const unsigned char *buf) in simple_object_fetch_little_32() argument [all …]
|
| /netbsd-src/external/gpl3/binutils/dist/libiberty/ |
| H A D | simple-object-common.h | 189 simple_object_fetch_big_16 (const unsigned char *buf) in simple_object_fetch_big_16() argument 191 return ((unsigned short) buf[0] << 8) | (unsigned short) buf[1]; in simple_object_fetch_big_16() 197 simple_object_fetch_little_16 (const unsigned char *buf) in simple_object_fetch_little_16() argument 199 return ((unsigned short) buf[1] << 8) | (unsigned short) buf[0]; in simple_object_fetch_little_16() 205 simple_object_fetch_big_32 (const unsigned char *buf) in simple_object_fetch_big_32() argument 207 return (((unsigned int) buf[0] << 24) in simple_object_fetch_big_32() 208 | ((unsigned int) buf[1] << 16) in simple_object_fetch_big_32() 209 | ((unsigned int) buf[2] << 8) in simple_object_fetch_big_32() 210 | (unsigned int) buf[3]); in simple_object_fetch_big_32() 216 simple_object_fetch_little_32 (const unsigned char *buf) in simple_object_fetch_little_32() argument [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libiberty/ |
| H A D | simple-object-common.h | 189 simple_object_fetch_big_16 (const unsigned char *buf) in simple_object_fetch_big_16() argument 191 return ((unsigned short) buf[0] << 8) | (unsigned short) buf[1]; in simple_object_fetch_big_16() 197 simple_object_fetch_little_16 (const unsigned char *buf) in simple_object_fetch_little_16() argument 199 return ((unsigned short) buf[1] << 8) | (unsigned short) buf[0]; in simple_object_fetch_little_16() 205 simple_object_fetch_big_32 (const unsigned char *buf) in simple_object_fetch_big_32() argument 207 return (((unsigned int) buf[0] << 24) in simple_object_fetch_big_32() 208 | ((unsigned int) buf[1] << 16) in simple_object_fetch_big_32() 209 | ((unsigned int) buf[2] << 8) in simple_object_fetch_big_32() 210 | (unsigned int) buf[3]); in simple_object_fetch_big_32() 216 simple_object_fetch_little_32 (const unsigned char *buf) in simple_object_fetch_little_32() argument [all …]
|
| /netbsd-src/external/gpl3/binutils.old/dist/libiberty/ |
| H A D | simple-object-common.h | 189 simple_object_fetch_big_16 (const unsigned char *buf) in simple_object_fetch_big_16() argument 191 return ((unsigned short) buf[0] << 8) | (unsigned short) buf[1]; in simple_object_fetch_big_16() 197 simple_object_fetch_little_16 (const unsigned char *buf) in simple_object_fetch_little_16() argument 199 return ((unsigned short) buf[1] << 8) | (unsigned short) buf[0]; in simple_object_fetch_little_16() 205 simple_object_fetch_big_32 (const unsigned char *buf) in simple_object_fetch_big_32() argument 207 return (((unsigned int) buf[0] << 24) in simple_object_fetch_big_32() 208 | ((unsigned int) buf[1] << 16) in simple_object_fetch_big_32() 209 | ((unsigned int) buf[2] << 8) in simple_object_fetch_big_32() 210 | (unsigned int) buf[3]); in simple_object_fetch_big_32() 216 simple_object_fetch_little_32 (const unsigned char *buf) in simple_object_fetch_little_32() argument [all …]
|
| /netbsd-src/external/bsd/wpa/dist/src/utils/ |
| H A D | wpabuf.c | 22 static struct wpabuf_trace * wpabuf_get_trace(const struct wpabuf *buf) in wpabuf_get_trace() argument 25 ((const u8 *) buf - sizeof(struct wpabuf_trace)); in wpabuf_get_trace() 30 static void wpabuf_overflow(const struct wpabuf *buf, size_t len) in wpabuf_overflow() argument 33 struct wpabuf_trace *trace = wpabuf_get_trace(buf); in wpabuf_overflow() 40 buf, (unsigned long) buf->size, (unsigned long) buf->used, in wpabuf_overflow() 49 struct wpabuf *buf = *_buf; in wpabuf_resize() local 54 if (buf == NULL) { in wpabuf_resize() 60 trace = wpabuf_get_trace(buf); in wpabuf_resize() 69 if (buf->used + add_len > buf->size) { in wpabuf_resize() 71 if (buf->flags & WPABUF_FLAG_EXT_DATA) { in wpabuf_resize() [all …]
|
| /netbsd-src/external/mpl/bind/dist/lib/isc/ |
| H A D | picohttpparser.c | 60 if (buf == buf_end) { \ 66 if (*buf++ != ch) { \ 77 const char *tok_start = buf; \ 81 buf = findchar_fast(buf, buf_end, ranges2, 4, &found2); \ 86 if (*buf == ' ') { \ 88 } else if (unlikely(!IS_PRINTABLE_ASCII(*buf))) { \ 89 if ((unsigned char)*buf < '\040' || \ 90 *buf == '\177') \ 96 ++buf; \ 114 findchar_fast(const char * buf,const char * buf_end,const char * ranges,size_t ranges_size,int * found) findchar_fast() argument 147 get_token_to_eol(const char * buf,const char * buf_end,const char ** token,size_t * token_len,int * ret) get_token_to_eol() argument 220 is_complete(const char * buf,const char * buf_end,size_t last_len,int * ret) is_complete() argument 268 parse_token(const char * buf,const char * buf_end,const char ** token,size_t * token_len,char next_char,int * ret) parse_token() argument 306 parse_http_version(const char * buf,const char * buf_end,int * minor_version,int * ret) parse_http_version() argument 325 parse_headers(const char * buf,const char * buf_end,struct phr_header * headers,size_t * num_headers,size_t max_headers,int * ret) parse_headers() argument 389 parse_request(const char * buf,const char * buf_end,const char ** method,size_t * method_len,const char ** path,size_t * path_len,int * minor_version,struct phr_header * headers,size_t * num_headers,size_t max_headers,int * ret) parse_request() argument 445 const char *buf = buf_start, *buf_end = buf_start + len; phr_parse_request() local 473 parse_response(const char * buf,const char * buf_end,int * minor_version,int * status,const char ** msg,size_t * msg_len,struct phr_header * headers,size_t * num_headers,size_t max_headers,int * ret) parse_response() argument 530 const char *buf = buf_start, *buf_end = buf + len; phr_parse_response() local 559 const char *buf = buf_start, *buf_end = buf + len; phr_parse_headers() local 603 phr_decode_chunked(struct phr_chunked_decoder * decoder,char * buf,size_t * _bufsz) phr_decode_chunked() argument [all...] |
| /netbsd-src/external/gpl3/binutils/dist/opcodes/ |
| H A D | z80-dis.c | 80 mach_inst (struct buffer *buf, const struct tab_elt *p) in mach_inst() argument 82 return !p->inss || (p->inss & buf->inss); in mach_inst() 86 fetch_data (struct buffer *buf, disassemble_info * info, int n) in fetch_data() argument 90 if (buf->n_fetch + n > (int)sizeof (buf->data)) in fetch_data() 93 r = info->read_memory_func (buf->base + buf->n_fetch, in fetch_data() 94 (unsigned char*) buf->data + buf->n_fetch, in fetch_data() 97 buf->n_fetch += n; in fetch_data() 99 info->memory_error_func (r, buf->base + buf->n_fetch, info); in fetch_data() 104 prt (struct buffer *buf, disassemble_info * info, const char *txt) in prt() argument 107 buf->n_used = buf->n_fetch; in prt() [all …]
|
| /netbsd-src/external/gpl3/binutils.old/dist/opcodes/ |
| H A D | z80-dis.c | 80 mach_inst (struct buffer *buf, const struct tab_elt *p) in mach_inst() argument 82 return !p->inss || (p->inss & buf->inss); in mach_inst() 86 fetch_data (struct buffer *buf, disassemble_info * info, int n) in fetch_data() argument 90 if (buf->n_fetch + n > (int)sizeof (buf->data)) in fetch_data() 93 r = info->read_memory_func (buf->base + buf->n_fetch, in fetch_data() 94 (unsigned char*) buf->data + buf->n_fetch, in fetch_data() 97 buf->n_fetch += n; in fetch_data() 99 info->memory_error_func (r, buf->base + buf->n_fetch, info); in fetch_data() 104 prt (struct buffer *buf, disassemble_info * info, const char *txt) in prt() argument 107 buf->n_used = buf->n_fetch; in prt() [all …]
|
| /netbsd-src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/tests/ |
| H A D | sanitizer_printf_test.cc | 23 char buf[1024]; in TEST() local 24 uptr len = internal_snprintf(buf, sizeof(buf), in TEST() 30 EXPECT_EQ(len, strlen(buf)); in TEST() 35 EXPECT_STREQ(expectedString.c_str(), buf); in TEST() 39 char buf[] = "123456789"; in TEST() local 40 uptr len = internal_snprintf(buf, 4, "%s", "abcdef"); // NOLINT in TEST() 42 EXPECT_STREQ("abc", buf); in TEST() 43 EXPECT_EQ(buf[3], 0); in TEST() 44 EXPECT_EQ(buf[4], '5'); in TEST() 45 EXPECT_EQ(buf[5], '6'); in TEST() [all …]
|
| /netbsd-src/external/bsd/flex/dist/src/ |
| H A D | buf.c | 58 struct Buf *buf_print_strings(struct Buf * buf, FILE* out) in buf_print_strings() argument 62 if(!buf || !out) in buf_print_strings() 63 return buf; in buf_print_strings() 65 for (i=0; i < buf->nelts; i++){ in buf_print_strings() 66 const char * s = ((char**)buf->elts)[i]; in buf_print_strings() 70 return buf; in buf_print_strings() 74 struct Buf *buf_prints (struct Buf *buf, const char *fmt, const char *s) in buf_prints() argument 84 buf = buf_strappend (buf, t); in buf_prints() 86 return buf; in buf_prints() 95 struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno) in buf_linedir() argument [all …]
|
| /netbsd-src/sys/arch/alpha/stand/standtest/ |
| H A D | test.c | 42 void (*fn)(const char *buf); 48 const char *advance_past_space(const char *buf); 49 const char *cvt_number(const char *buf, u_int64_t *nump); 50 int dispatch_cmd(const char *buf, const struct cmdtab *cmds); 59 void toplevel_dpb(const char *buf); 60 void toplevel_dpl(const char *buf); 61 void toplevel_dpq(const char *buf); 62 void toplevel_dpw(const char *buf); 63 void toplevel_dvb(const char *buf); 64 void toplevel_dvl(const char *buf); [all …]
|
| /netbsd-src/usr.bin/xlint/common/ |
| H A D | tyname.c | 101 buf_init(buffer *buf) 103 buf->len = 0; in buf_init() 104 buf->cap = 128; in buf_init() 105 buf->data = xmalloc(buf->cap); in buf_init() 106 buf->data[0] = '\0'; in buf_init() 110 buf_done(buffer *buf) 112 free(buf->data); in buf_done() 116 buf_add_mem(buffer *buf, const char *s, size_t n) 118 while (buf in buf_add_mem() 102 buf_init(buffer * buf) buf_init() argument 111 buf_done(buffer * buf) buf_done() argument 117 buf_add_mem(buffer * buf,const char * s,size_t n) buf_add_mem() argument 131 buf_add_char(buffer * buf,char c) buf_add_char() argument 138 buf_add(buffer * buf,const char * s) buf_add() argument 144 buf_add_int(buffer * buf,int n) buf_add_int() argument 161 type_name_of_function(buffer * buf,const type_t * tp) type_name_of_function() argument 196 type_name_of_struct_or_union(buffer * buf,const type_t * tp) type_name_of_struct_or_union() argument 213 type_name_of_enum(buffer * buf,const type_t * tp) type_name_of_enum() argument 230 type_name_of_array(buffer * buf,const type_t * tp) type_name_of_array() argument 250 buffer buf; type_name() local [all...] |
| /netbsd-src/external/mpl/dhcp/dist/common/ |
| H A D | print.c | 42 char *buf, *nsp; in quotify_string() local 55 buf = dmalloc (len + 1, file, line); in quotify_string() 56 if (buf) { in quotify_string() 57 nsp = buf; in quotify_string() 73 return buf; in quotify_string() 80 char *buf, *nsp; in quotify_buf() local 98 buf = dmalloc (nulen + 1, MDL); in quotify_buf() 99 if (buf) { in quotify_buf() 100 nsp = buf; in quotify_buf() 123 return buf; in quotify_buf() [all …]
|
| /netbsd-src/external/bsd/wpa/dist/src/common/ |
| H A D | gas.c | 20 struct wpabuf *buf; in gas_build_req() local 22 buf = wpabuf_alloc(100 + size); in gas_build_req() 23 if (buf == NULL) in gas_build_req() 26 wpabuf_put_u8(buf, WLAN_ACTION_PUBLIC); in gas_build_req() 27 wpabuf_put_u8(buf, action); in gas_build_req() 28 wpabuf_put_u8(buf, dialog_token); in gas_build_req() 30 return buf; in gas_build_req() 51 struct wpabuf *buf; in gas_build_resp() local 53 buf = wpabuf_alloc(100 + size); in gas_build_resp() 54 if (buf == NULL) in gas_build_resp() [all …]
|
| /netbsd-src/usr.bin/make/ |
| H A D | buf.c | 82 Buf_Expand(Buffer *buf) in Buf_Expand() argument 84 buf->cap += buf->cap > 16 ? buf->cap : 16; in Buf_Expand() 85 buf->data = bmake_realloc(buf->data, buf->cap); in Buf_Expand() 90 Buf_AddBytes(Buffer *buf, const char *bytes, size_t bytes_len) in Buf_AddBytes() argument 92 size_t old_len = buf->len; in Buf_AddBytes() 95 if (old_len + bytes_len >= buf->cap) { in Buf_AddBytes() 97 buf->cap += buf->cap > minIncr ? buf->cap : minIncr; in Buf_AddBytes() 98 buf->data = bmake_realloc(buf->data, buf->cap); in Buf_AddBytes() 101 end = buf->data + old_len; in Buf_AddBytes() 102 buf->len = old_len + bytes_len; in Buf_AddBytes() [all …]
|
| /netbsd-src/sys/arch/sh3/sh3/ |
| H A D | db_disasm.c | 176 get_opcode(const uint16_t *pc, char *buf, size_t len) in get_opcode() argument 181 strlcpy(buf, "????", len); in get_opcode() 187 (*f[n0][n3])(pc, buf, len); in get_opcode() 192 f_02(const uint16_t *pc, char *buf, size_t len) in f_02() argument 205 snprintf(buf, len, "stc sr, r%d", rn); in f_02() 209 snprintf(buf, len, "stc gbr, r%d", rn); in f_02() 213 snprintf(buf, len, "stc vbr, r%d", rn); in f_02() 217 snprintf(buf, len, "stc ssr, r%d", rn); in f_02() 226 snprintf(buf, len, "stc spc, r%d", rn); in f_02() 232 snprintf(buf, len, "stc r%d_bank, r%d", md, rn); in f_02() [all …]
|
| /netbsd-src/external/gpl2/dtc/dist/tests/ |
| H A D | mangle-layout.c | 22 char *buf; member 26 static void expand_buf(struct bufstate *buf, int newsize) in expand_buf() argument 28 buf->buf = realloc(buf->buf, newsize); in expand_buf() 29 if (!buf->buf) in expand_buf() 31 buf->size = newsize; in expand_buf() 34 static void new_header(struct bufstate *buf, int version, const void *fdt) in new_header() argument 41 expand_buf(buf, hdrsize); in new_header() 42 memset(buf->buf, 0, hdrsize); in new_header() 44 fdt_set_magic(buf->buf, FDT_MAGIC); in new_header() 45 fdt_set_version(buf->buf, version); in new_header() [all …]
|
| /netbsd-src/external/bsd/libevent/dist/test/ |
| H A D | regress_buffer.c | 75 evbuffer_validate_(struct evbuffer *buf) in evbuffer_validate_() argument 81 if (buf->first == NULL) { in evbuffer_validate_() 82 tt_assert(buf->last == NULL); in evbuffer_validate_() 83 tt_assert(buf->total_len == 0); in evbuffer_validate_() 86 chain = buf->first; in evbuffer_validate_() 88 tt_assert(buf->last_with_datap); in evbuffer_validate_() 89 if (buf->last_with_datap == &buf->first) in evbuffer_validate_() 93 if (&chain->next == buf->last_with_datap) in evbuffer_validate_() 97 tt_assert(buf->last == chain); in evbuffer_validate_() 103 if (buf->first) in evbuffer_validate_() [all …]
|