Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 3976) sorted by relevance

12345678910>>...160

/openbsd-src/usr.bin/ssh/
H A Dsshbuf.c33 buf->size, buf->alloc, buf->off, buf->max_size); \
43 size_t off; /* First available byte is buf->d + buf->off */
44 size_t size; /* Last byte is buf->d + buf->size - 1 */
46 size_t alloc; /* Total bytes allocated to buf->d */
53 sshbuf_check_sanity(const struct sshbuf *buf) in sshbuf_check_sanity() argument
74 sshbuf_maybe_pack(struct sshbuf * buf,int force) sshbuf_maybe_pack() argument
141 sshbuf_fromb(struct sshbuf * buf) sshbuf_fromb() argument
157 sshbuf_free(struct sshbuf * buf) sshbuf_free() argument
194 sshbuf_reset(struct sshbuf * buf) sshbuf_reset() argument
217 sshbuf_max_size(const struct sshbuf * buf) sshbuf_max_size() argument
223 sshbuf_alloc(const struct sshbuf * buf) sshbuf_alloc() argument
229 sshbuf_parent(const struct sshbuf * buf) sshbuf_parent() argument
235 sshbuf_refcount(const struct sshbuf * buf) sshbuf_refcount() argument
241 sshbuf_set_max_size(struct sshbuf * buf,size_t max_size) sshbuf_set_max_size() argument
279 sshbuf_len(const struct sshbuf * buf) sshbuf_len() argument
287 sshbuf_avail(const struct sshbuf * buf) sshbuf_avail() argument
295 sshbuf_ptr(const struct sshbuf * buf) sshbuf_ptr() argument
303 sshbuf_mutable_ptr(const struct sshbuf * buf) sshbuf_mutable_ptr() argument
311 sshbuf_check_reserve(const struct sshbuf * buf,size_t len) sshbuf_check_reserve() argument
327 sshbuf_allocate(struct sshbuf * buf,size_t len) sshbuf_allocate() argument
370 sshbuf_reserve(struct sshbuf * buf,size_t len,u_char ** dpp) sshbuf_reserve() argument
390 sshbuf_consume(struct sshbuf * buf,size_t len) sshbuf_consume() argument
410 sshbuf_consume_end(struct sshbuf * buf,size_t len) sshbuf_consume_end() argument
[all...]
/openbsd-src/lib/libssl/
H A Dtls_buffer.c34 static int tls_buffer_resize(struct tls_buffer *buf, size_t capacity);
39 struct tls_buffer *buf = NULL; in tls_buffer_new() local
41 if ((buf = calloc(1, sizeof(struct tls_buffer))) == NULL) in tls_buffer_new()
44 buf->capacity_limit = TLS_BUFFER_CAPACITY_LIMIT; in tls_buffer_new()
46 if (!tls_buffer_resize(buf, init_size)) in tls_buffer_new()
49 return buf; in tls_buffer_new()
52 tls_buffer_free(buf); in tls_buffer_new()
58 tls_buffer_clear(struct tls_buffer *buf) in tls_buffer_clear() argument
60 freezero(buf->data, buf->capacity); in tls_buffer_clear()
62 buf->data = NULL; in tls_buffer_clear()
[all …]
/openbsd-src/lib/libutil/
H A Dimsg-buffer.c57 struct ibuf *buf; in ibuf_open()
59 if ((buf = calloc(1, sizeof(struct ibuf))) == NULL) in ibuf_open()
62 if ((buf->buf = calloc(len, 1)) == NULL) { in ibuf_dynamic()
63 free(buf); in ibuf_dynamic()
67 buf->size = buf->max = len; in ibuf_dynamic()
68 buf->fd = -1; in ibuf_dynamic()
70 return (buf); in ibuf_dynamic()
76 struct ibuf *buf; in ibuf_dynamic()
43 struct ibuf *buf; ibuf_open() local
64 struct ibuf *buf; ibuf_dynamic() local
87 ibuf_realloc(struct ibuf * buf,size_t len) ibuf_realloc() argument
107 ibuf_reserve(struct ibuf * buf,size_t len) ibuf_reserve() argument
126 ibuf_add(struct ibuf * buf,const void * data,size_t len) ibuf_add() argument
138 ibuf_add_ibuf(struct ibuf * buf,const struct ibuf * from) ibuf_add_ibuf() argument
145 ibuf_add_buf(struct ibuf * buf,const struct ibuf * from) ibuf_add_buf() argument
151 ibuf_add_n8(struct ibuf * buf,uint64_t value) ibuf_add_n8() argument
164 ibuf_add_n16(struct ibuf * buf,uint64_t value) ibuf_add_n16() argument
177 ibuf_add_n32(struct ibuf * buf,uint64_t value) ibuf_add_n32() argument
190 ibuf_add_n64(struct ibuf * buf,uint64_t value) ibuf_add_n64() argument
197 ibuf_add_h16(struct ibuf * buf,uint64_t value) ibuf_add_h16() argument
210 ibuf_add_h32(struct ibuf * buf,uint64_t value) ibuf_add_h32() argument
223 ibuf_add_h64(struct ibuf * buf,uint64_t value) ibuf_add_h64() argument
229 ibuf_add_zero(struct ibuf * buf,size_t len) ibuf_add_zero() argument
240 ibuf_seek(struct ibuf * buf,size_t pos,size_t len) ibuf_seek() argument
253 ibuf_set(struct ibuf * buf,size_t pos,const void * data,size_t len) ibuf_set() argument
265 ibuf_set_n8(struct ibuf * buf,size_t pos,uint64_t value) ibuf_set_n8() argument
278 ibuf_set_n16(struct ibuf * buf,size_t pos,uint64_t value) ibuf_set_n16() argument
291 ibuf_set_n32(struct ibuf * buf,size_t pos,uint64_t value) ibuf_set_n32() argument
304 ibuf_set_n64(struct ibuf * buf,size_t pos,uint64_t value) ibuf_set_n64() argument
311 ibuf_set_h16(struct ibuf * buf,size_t pos,uint64_t value) ibuf_set_h16() argument
324 ibuf_set_h32(struct ibuf * buf,size_t pos,uint64_t value) ibuf_set_h32() argument
337 ibuf_set_h64(struct ibuf * buf,size_t pos,uint64_t value) ibuf_set_h64() argument
343 ibuf_data(const struct ibuf * buf) ibuf_data() argument
349 ibuf_size(const struct ibuf * buf) ibuf_size() argument
355 ibuf_left(const struct ibuf * buf) ibuf_left() argument
363 ibuf_truncate(struct ibuf * buf,size_t len) ibuf_truncate() argument
378 ibuf_rewind(struct ibuf * buf) ibuf_rewind() argument
384 ibuf_close(struct msgbuf * msgbuf,struct ibuf * buf) ibuf_close() argument
390 ibuf_from_buffer(struct ibuf * buf,void * data,size_t len) ibuf_from_buffer() argument
399 ibuf_from_ibuf(struct ibuf * buf,const struct ibuf * from) ibuf_from_ibuf() argument
405 ibuf_get(struct ibuf * buf,void * data,size_t len) ibuf_get() argument
418 ibuf_get_ibuf(struct ibuf * buf,size_t len,struct ibuf * new) ibuf_get_ibuf() argument
431 ibuf_get_n8(struct ibuf * buf,uint8_t * value) ibuf_get_n8() argument
437 ibuf_get_n16(struct ibuf * buf,uint16_t * value) ibuf_get_n16() argument
447 ibuf_get_n32(struct ibuf * buf,uint32_t * value) ibuf_get_n32() argument
457 ibuf_get_n64(struct ibuf * buf,uint64_t * value) ibuf_get_n64() argument
467 ibuf_get_h16(struct ibuf * buf,uint16_t * value) ibuf_get_h16() argument
473 ibuf_get_h32(struct ibuf * buf,uint32_t * value) ibuf_get_h32() argument
479 ibuf_get_h64(struct ibuf * buf,uint64_t * value) ibuf_get_h64() argument
485 ibuf_skip(struct ibuf * buf,size_t len) ibuf_skip() argument
497 ibuf_free(struct ibuf * buf) ibuf_free() argument
510 ibuf_fd_avail(struct ibuf * buf) ibuf_fd_avail() argument
516 ibuf_fd_get(struct ibuf * buf) ibuf_fd_get() argument
526 ibuf_fd_set(struct ibuf * buf,int fd) ibuf_fd_set() argument
539 struct ibuf *buf; ibuf_write() local
582 struct ibuf *buf, *next; msgbuf_drain() local
600 struct ibuf *buf; msgbuf_clear() local
610 struct ibuf *buf, *buf0 = NULL; msgbuf_write() local
617 char buf[CMSG_SPACE(sizeof(int))]; msgbuf_write() member
683 ibuf_enqueue(struct msgbuf * msgbuf,struct ibuf * buf) ibuf_enqueue() argument
692 ibuf_dequeue(struct msgbuf * msgbuf,struct ibuf * buf) ibuf_dequeue() argument
[all...]
/openbsd-src/gnu/usr.bin/binutils-2.17/opcodes/
H A Dz80-dis.c56 fetch_data (struct buffer *buf, disassemble_info * info, int n) in fetch_data() argument
60 if (buf->n_fetch + n > 4) in fetch_data()
63 r = info->read_memory_func (buf->base + buf->n_fetch, in fetch_data()
64 (unsigned char*) buf->data + buf->n_fetch, in fetch_data()
67 buf->n_fetch += n; in fetch_data()
72 prt (struct buffer *buf, disassemble_info * info, char *txt) in prt() argument
75 buf->n_used = buf->n_fetch; in prt()
80 prt_e (struct buffer *buf, disassemble_info * info, char *txt) in prt_e() argument
85 if (fetch_data (buf, info, 1)) in prt_e()
87 e = buf->data[1]; in prt_e()
[all …]
/openbsd-src/gnu/llvm/compiler-rt/lib/sanitizer_common/tests/
H A Dsanitizer_printf_test.cpp22 char buf[1024]; in TEST() local
24 buf, sizeof(buf), "a%db%zdc%ue%zuf%xh%zxq%pe%sr", (int)-1, (uptr)-2, in TEST()
26 EXPECT_EQ(len, strlen(buf)); in TEST()
31 EXPECT_STREQ(expectedString.c_str(), buf); in TEST()
35 char buf[] = "123456789"; in TEST() local
36 uptr len = internal_snprintf(buf, 4, "%s", "abcdef"); in TEST()
38 EXPECT_STREQ("abc", buf); in TEST()
39 EXPECT_EQ(buf[3], 0); in TEST()
40 EXPECT_EQ(buf[4], '5'); in TEST()
41 EXPECT_EQ(buf[5], '6'); in TEST()
[all …]
/openbsd-src/regress/lib/libc/strchr/
H A Dstrchrtest.c28 char *buf; in main() local
33 buf = malloc(bufsize); in main()
34 if (buf == NULL) { in main()
39 memset(buf, 0, bufsize); in main()
40 assert(strchr(buf, 'a') == NULL); in main()
41 assert(strchr(buf, '\0') == buf); in main()
42 assert(strrchr(buf, 'a') == NULL); in main()
43 assert(strrchr(buf, '\0') == buf); in main()
45 memcpy(buf, "haystack\xcf\x80", 10); in main()
46 assert(strchr(buf, 'a') == buf + 1); in main()
[all …]
/openbsd-src/usr.bin/lex/
H A Dbuf.c59 buf_print_strings(struct Buf * buf, FILE * out) in buf_print_strings() argument
63 if (!buf || !out) in buf_print_strings()
64 return buf; in buf_print_strings()
66 for (i = 0; i < buf->nelts; i++) { in buf_print_strings()
67 const char *s = ((char **) buf->elts)[i]; in buf_print_strings()
71 return buf; in buf_print_strings()
76 buf_prints(struct Buf * buf, const char *fmt, const char *s) in buf_prints() argument
86 buf = buf_strappend(buf, t); in buf_prints()
88 return buf; in buf_prints()
98 buf_linedir(struct Buf * buf, const char *filename, int lineno) in buf_linedir() argument
[all …]
/openbsd-src/usr.bin/aucat/
H A Dabuf.c29 abuf_init(struct abuf *buf, unsigned int len)
31 buf->data = xmalloc(len);
32 buf->len = len; in abuf_log() argument
33 buf->used = 0; in abuf_log()
34 buf->start = 0; in abuf_log()
38 abuf_done(struct abuf *buf) in abuf_log()
41 if (buf->used > 0)
42 logx(3, "deleting non-empty buffer, used = %d", buf->used);
44 xfree(buf->data); in abuf_init()
45 buf in abuf_init()
43 abuf_init(struct abuf * buf,unsigned int len) abuf_init() argument
52 abuf_done(struct abuf * buf) abuf_done() argument
71 abuf_rgetblk(struct abuf * buf,int * rsize) abuf_rgetblk() argument
86 abuf_rdiscard(struct abuf * buf,int count) abuf_rdiscard() argument
106 abuf_wcommit(struct abuf * buf,int count) abuf_wcommit() argument
123 abuf_wgetblk(struct abuf * buf,int * rsize) abuf_wgetblk() argument
[all...]
/openbsd-src/usr.bin/sndiod/
H A Dabuf.c33 abuf_init(struct abuf *buf, unsigned int len)
35 buf->data = xmalloc(len); in abuf_log()
36 buf->len = len; in abuf_log()
37 buf->used = 0; in abuf_log()
38 buf->start = 0; in abuf_log()
42 abuf_done(struct abuf *buf)
45 if (buf->used > 0) in abuf_init() argument
46 logx(3, "deleting non-empty buffer, used = %d", buf->used); in abuf_init()
48 xfree(buf->data); in abuf_init()
49 buf in abuf_init()
34 abuf_log(struct abuf * buf) abuf_log() argument
54 abuf_done(struct abuf * buf) abuf_done() argument
73 abuf_rgetblk(struct abuf * buf,int * rsize) abuf_rgetblk() argument
88 abuf_rdiscard(struct abuf * buf,int count) abuf_rdiscard() argument
108 abuf_wcommit(struct abuf * buf,int count) abuf_wcommit() argument
125 abuf_wgetblk(struct abuf * buf,int * rsize) abuf_wgetblk() argument
[all...]
/openbsd-src/usr.bin/nc/
H A Dsocks.c91 proxy_read_line(int fd, char *buf, size_t bufsz) in proxy_read_line() argument
98 if (atomicio(read, fd, buf + off, 1) != 1) in proxy_read_line()
101 if (buf[off] == '\r') in proxy_read_line()
103 if (buf[off] == '\n') { in proxy_read_line()
104 buf[off] = '\0'; in proxy_read_line()
184 unsigned char buf[1024]; in socks_connect() local
215 buf[0] = SOCKS_V5; in socks_connect()
216 buf[1] = 1; in socks_connect()
217 buf[2] = SOCKS_NOAUTH; in socks_connect()
218 cnt = atomicio(vwrite, proxyfd, buf, 3); in socks_connect()
[all …]
/openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/gcc.c-torture/execute/
H A Dmemset-2.c23 char buf[MAX_LENGTH]; member
35 u.buf[i] = 'a'; in reset()
43 q = u.buf; in check()
67 p = memset (u.buf + off, '\0', 1); in main()
68 if (p != u.buf + off) abort (); in main()
71 p = memset (u.buf + off, A, 1); in main()
72 if (p != u.buf + off) abort (); in main()
75 p = memset (u.buf + off, 'B', 1); in main()
76 if (p != u.buf + off) abort (); in main()
85 p = memset (u.buf + off, '\0', 2); in main()
[all …]
H A Dmemset-3.c23 char buf[MAX_LENGTH]; member
35 u.buf[i] = 'a'; in reset()
43 q = u.buf; in check()
67 p = memset (u.buf, '\0', len); in main()
68 if (p != u.buf) abort (); in main()
71 p = memset (u.buf, A, len); in main()
72 if (p != u.buf) abort (); in main()
75 p = memset (u.buf, 'B', len); in main()
76 if (p != u.buf) abort (); in main()
85 p = memset (u.buf+1, '\0', len); in main()
[all …]
/openbsd-src/lib/libevent/
H A Dbuffer.c114 evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap) in evbuffer_add_vprintf() argument
118 size_t oldoff = buf->off; in evbuffer_add_vprintf()
123 if (evbuffer_expand(buf, 64) < 0) in evbuffer_add_vprintf()
126 size_t used = buf->misalign + buf->off; in evbuffer_add_vprintf()
127 buffer = (char *)buf->buffer + buf->off; in evbuffer_add_vprintf()
128 assert(buf->totallen >= used); in evbuffer_add_vprintf()
129 space = buf->totallen - used; in evbuffer_add_vprintf()
140 buf->off += sz; in evbuffer_add_vprintf()
141 if (buf->cb != NULL) in evbuffer_add_vprintf()
142 (*buf->cb)(buf, oldoff, buf->off, buf->cbarg); in evbuffer_add_vprintf()
[all …]
/openbsd-src/sys/sys/
H A Dbuf.h47 #define NOLIST ((struct buf *)0x87654321)
49 struct buf;
52 LIST_HEAD(bufhead, buf);
90 void bufq_queue(struct bufq *, struct buf *);
91 struct buf *bufq_dequeue(struct bufq *);
92 void bufq_requeue(struct bufq *, struct buf *);
97 void bufq_done(struct bufq *, struct buf *);
102 SIMPLEQ_HEAD(bufq_fifo_head, buf);
104 SIMPLEQ_ENTRY(buf) bqf_entries;
108 SIMPLEQ_HEAD(bufq_nscan_head, buf);
[all …]
/openbsd-src/sys/arch/sh/sh/
H A Ddb_disasm.c150 disasm_branch(char *buf, size_t bufsiz, const char *opstr, vaddr_t addr) in disasm_branch() argument
159 snprintf(buf, bufsiz, "%-8s", opstr); in disasm_branch()
160 len = strlen(buf); in disasm_branch()
161 buf += len; in disasm_branch()
169 snprintf(buf, bufsiz, "%s", name); in disasm_branch()
171 snprintf(buf, bufsiz, "%s+", name); in disasm_branch()
172 len = strlen(buf); in disasm_branch()
173 buf += len; in disasm_branch()
175 db_format(buf, bufsiz, d, DB_FORMAT_R, 1, 0); in disasm_branch()
181 db_format(buf, bufsi in disasm_branch()
194 get_opcode(vaddr_t loc,char * buf,size_t bufsiz) get_opcode() argument
209 f_02(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_02() argument
251 f_03(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_03() argument
281 f_04(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_04() argument
306 f_08(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_08() argument
348 f_09(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_09() argument
373 f_0a(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_0a() argument
409 f_0b(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_0b() argument
432 f_0c(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_0c() argument
457 f_10(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_10() argument
470 f_20(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_20() argument
492 f_24(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_24() argument
517 f_28(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_28() argument
542 f_2c(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_2c() argument
567 f_30(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_30() argument
589 f_34(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_34() argument
614 f_38(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_38() argument
636 f_3c(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_3c() argument
661 f_40(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_40() argument
682 f_41(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_41() argument
703 f_42(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_42() argument
739 f_43(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_43() argument
781 f_44(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_44() argument
799 f_45(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_45() argument
820 f_46(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_46() argument
856 f_47(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_47() argument
898 f_48(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_48() argument
919 f_49(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_49() argument
940 f_4a(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_4a() argument
976 f_4b(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_4b() argument
997 f_4c(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_4c() argument
1007 f_4d(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_4d() argument
1017 f_4e(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_4e() argument
1059 f_4f(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_4f() argument
1069 f_50(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_50() argument
1082 f_60(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_60() argument
1107 f_64(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_64() argument
1132 f_68(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_68() argument
1157 f_6c(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_6c() argument
1182 f_70(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_70() argument
1193 f_80(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_80() argument
1269 f_90(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_90() argument
1281 f_a0(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_a0() argument
1294 f_b0(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_b0() argument
1307 f_c0(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_c0() argument
1389 f_d0(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_d0() argument
1401 f_e0(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_e0() argument
1412 f_f0(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_f0() argument
1437 f_f4(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_f4() argument
1462 f_f8(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_f8() argument
1487 f_fc(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_fc() argument
1498 f_fd(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_fd() argument
1548 f_fe(vaddr_t loc,u_int insn,char * buf,size_t bufsiz) f_fe() argument
[all...]
/openbsd-src/usr.sbin/smtpd/
H A Denvelope.c69 char *buf, *field, *nextline; in envelope_buffer_to_dict() local
74 buf = lbuf; in envelope_buffer_to_dict()
77 len = strcspn(buf, "\n"); in envelope_buffer_to_dict()
78 buf[len] = '\0'; in envelope_buffer_to_dict()
79 nextline = buf + len + 1; in envelope_buffer_to_dict()
80 buflen -= (nextline - buf); in envelope_buffer_to_dict()
82 field = buf; in envelope_buffer_to_dict()
83 while (*buf && (isalnum((unsigned char)*buf) || *buf == '-')) in envelope_buffer_to_dict()
84 buf++; in envelope_buffer_to_dict()
85 if (!*buf) in envelope_buffer_to_dict()
[all …]
H A Dto.c44 static char buf[NI_MAXHOST]; in sockaddr_to_text() local
46 if (getnameinfo(sa, sa->sa_len, buf, sizeof(buf), NULL, 0, in sockaddr_to_text()
50 return (buf); in sockaddr_to_text()
109 static char buf[NI_MAXHOST + 5]; in sa_to_text() local
112 buf[0] = '\0'; in sa_to_text()
113 p = buf; in sa_to_text()
116 (void)strlcpy(buf, "local", sizeof buf); in sa_to_text()
130 return (buf); in sa_to_text()
143 static char buf[40]; in time_to_text() local
158 if (!bsnprintf(buf, sizeof(buf), in time_to_text()
[all …]
/openbsd-src/usr.sbin/ldpd/
H A Dlogmsg.c37 static char buf[NUM_LOGS][NI_MAXHOST]; in log_sockaddr() local
43 if (getnameinfo(sa, sa->sa_len, buf[round], NI_MAXHOST, NULL, 0, in log_sockaddr()
47 return (buf[round]); in log_sockaddr()
83 static char buf[NUM_LOGS][INET6_ADDRSTRLEN]; in log_addr() local
89 if (inet_ntop(AF_INET, &addr->v4, buf[round], in log_addr()
90 sizeof(buf[round])) == NULL) in log_addr()
92 return (buf[round]); in log_addr()
108 char *buf; in log_label() local
112 buf = tfbuf[idx++]; in log_label()
118 snprintf(buf, TF_LEN, "-"); in log_label()
[all …]
/openbsd-src/gnu/usr.bin/cvs/src/
H A Dbuffer.c35 struct buffer *buf; variable
37 buf = (struct buffer *) xmalloc (sizeof (struct buffer));
38 buf->data = NULL;
39 buf->last = NULL;
40 buf->nonblocking = 0;
41 buf->input = input;
42 buf->output = output;
43 buf->flush = flush;
44 buf->block = block;
45 buf->shutdown = shutdown;
[all …]
/openbsd-src/usr.sbin/tcpdump/
H A Dsmbutil.c163 static const uchar *name_ptr(const uchar *buf,int ofs,const uchar *maxbuf) in name_ptr() argument
168 p = buf+ofs; in name_ptr()
178 uint16 l = RSVAL(buf, ofs) & 0x3FFF; in name_ptr()
184 p = buf + l; in name_ptr()
188 return(buf + l); in name_ptr()
191 return(buf+ofs); in name_ptr()
200 static int name_extract(const uchar *buf,int ofs,const uchar *maxbuf,char *name) in name_extract() argument
202 const uchar *p = name_ptr(buf,ofs,maxbuf); in name_extract()
269 static char buf[1000]; in unistr() local
294 while (l < (sizeof(buf)-1) && s[0] && s[1] == 0) { in unistr()
[all …]
/openbsd-src/gnu/usr.bin/perl/cpan/Time-Piece/
H A DPiece.xs339 _strptime(pTHX_ const char *buf, const char *fmt, struct tm *tm, int *got_GMT) in _strptime() argument
353 if (*buf == 0) in _strptime()
360 while (*buf != 0 && isspace((unsigned char)*buf)) in _strptime()
361 buf++; in _strptime()
362 else if (c != *buf++) in _strptime()
374 if (*buf++ != '%') in _strptime()
379 buf = _strptime(aTHX_ buf, "%c", tm, got_GMT); in _strptime()
380 if (buf == 0) in _strptime()
385 if (!isdigit((unsigned char)*buf)) in _strptime()
390 for (i = 0; len && *buf != 0 && isdigit((unsigned char)*buf); buf++) { in _strptime()
[all …]
/openbsd-src/usr.bin/rsync/
H A Dlog.c36 char *buf = NULL; in rsync_log() local
44 if (vasprintf(&buf, fmt, ap) == -1) { in rsync_log()
51 if (level <= 0 && buf != NULL) in rsync_log()
52 fprintf(stderr, "%s\n", buf); in rsync_log()
55 (buf != NULL) ? ": " : "", in rsync_log()
56 (buf != NULL) ? buf : ""); in rsync_log()
57 free(buf); in rsync_log()
67 char *buf = NULL; in rsync_errx() local
72 if (vasprintf(&buf, fmt, ap) == -1) { in rsync_errx()
80 (buf != NULL) ? ": " : "", in rsync_errx()
[all …]
/openbsd-src/regress/usr.bin/ssh/unittests/sshkey/
H A Dtest_file.c39 struct sshbuf *buf, *pw; in sshkey_file_tests() local
49 buf = load_file("rsa_1"); in sshkey_file_tests()
50 ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", &k1, NULL), 0); in sshkey_file_tests()
51 sshbuf_free(buf); in sshkey_file_tests()
65 buf = load_file("rsa_1_pw"); in sshkey_file_tests()
66 ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, in sshkey_file_tests()
68 sshbuf_free(buf); in sshkey_file_tests()
75 buf = load_file("rsa_n"); in sshkey_file_tests()
76 ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", &k2, NULL), 0); in sshkey_file_tests()
77 sshbuf_free(buf); in sshkey_file_tests()
[all...]
/openbsd-src/sys/dev/
H A Dmidivar.h42 #define MIDIBUF_START(buf) ((buf)->start)
43 #define MIDIBUF_END(buf) (((buf)->start + (buf)->used) & MIDIBUF_MASK) argument
44 #define MIDIBUF_USED(buf) ((buf)->used) argument
45 #define MIDIBUF_AVAIL(buf) (MIDIBUF_SIZE - (buf)->used) argument
46 #define MIDIBUF_ISFULL(buf) ((bu argument
47 MIDIBUF_ISFULL(buf) global() argument
48 MIDIBUF_ISEMPTY(buf) global() argument
49 MIDIBUF_WRITE(buf,byte) global() argument
54 MIDIBUF_READ(buf,byte) global() argument
60 MIDIBUF_REMOVE(buf,count) global() argument
66 MIDIBUF_INIT(buf) global() argument
[all...]
/openbsd-src/gnu/lib/libiberty/src/
H A Dvsnprintf.c59 char *buf = 0; in vsnprintf() local
60 int result = vasprintf (&buf, format, ap); in vsnprintf()
62 if (!buf) in vsnprintf()
66 free (buf); in vsnprintf()
70 result = strlen (buf); in vsnprintf()
74 memcpy (s, buf, result+1); in vsnprintf()
77 memcpy (s, buf, n-1); in vsnprintf()
81 free (buf); in vsnprintf()
108 char buf[128]; in main() local
111 CLEAR (buf); in main()
[all …]

12345678910>>...160