Home
last modified time | relevance | path

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

12345678910>>...168

/openbsd/src/usr.bin/ssh/
Dsshbuf.c33 buf->size, buf->alloc, buf->off, buf->max_size); \
53 sshbuf_check_sanity(const struct sshbuf *buf) in sshbuf_check_sanity() argument
56 if (__predict_false(buf == NULL || in sshbuf_check_sanity()
57 (!buf->readonly && buf->d != buf->cd) || in sshbuf_check_sanity()
58 buf->parent == buf || in sshbuf_check_sanity()
59 buf->refcount < 1 || buf->refcount > SSHBUF_REFS_MAX || in sshbuf_check_sanity()
60 buf->cd == NULL || in sshbuf_check_sanity()
61 buf->max_size > SSHBUF_SIZE_MAX || in sshbuf_check_sanity()
62 buf->alloc > buf->max_size || in sshbuf_check_sanity()
63 buf->size > buf->alloc || in sshbuf_check_sanity()
[all …]
Dsshbuf.h63 struct sshbuf *sshbuf_fromb(struct sshbuf *buf);
72 int sshbuf_froms(struct sshbuf *buf, struct sshbuf **bufp);
77 void sshbuf_free(struct sshbuf *buf);
82 void sshbuf_reset(struct sshbuf *buf);
87 size_t sshbuf_max_size(const struct sshbuf *buf);
93 int sshbuf_set_max_size(struct sshbuf *buf, size_t max_size);
98 size_t sshbuf_len(const struct sshbuf *buf);
103 size_t sshbuf_avail(const struct sshbuf *buf);
108 const u_char *sshbuf_ptr(const struct sshbuf *buf);
114 u_char *sshbuf_mutable_ptr(const struct sshbuf *buf);
[all …]
/openbsd/src/lib/libssl/
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/gnu/usr.bin/binutils-2.17/opcodes/
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/lib/libutil/
Dimsg-buffer.c57 struct ibuf *buf; in ibuf_open() local
59 if ((buf = calloc(1, sizeof(struct ibuf))) == NULL) in ibuf_open()
62 if ((buf->buf = calloc(len, 1)) == NULL) { in ibuf_open()
63 free(buf); in ibuf_open()
67 buf->size = buf->max = len; in ibuf_open()
68 buf->fd = -1; in ibuf_open()
70 return (buf); in ibuf_open()
76 struct ibuf *buf; in ibuf_dynamic() local
83 if ((buf = calloc(1, sizeof(struct ibuf))) == NULL) in ibuf_dynamic()
86 if ((buf->buf = calloc(len, 1)) == NULL) { in ibuf_dynamic()
[all …]
/openbsd/src/gnu/llvm/compiler-rt/lib/sanitizer_common/tests/
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/
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/
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/nc/
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/lib/libevent/
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/gnu/usr.bin/gcc/gcc/testsuite/gcc.c-torture/execute/
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 …]
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/usr.bin/sndiod/
Dabuf.c33 abuf_init(struct abuf *buf, unsigned int len) in abuf_init() argument
35 buf->data = xmalloc(len); in abuf_init()
36 buf->len = len; in abuf_init()
37 buf->used = 0; in abuf_init()
38 buf->start = 0; in abuf_init()
42 abuf_done(struct abuf *buf) in abuf_done() argument
45 if (buf->used > 0) in abuf_done()
46 logx(3, "deleting non-empty buffer, used = %d", buf->used); in abuf_done()
48 xfree(buf->data); in abuf_done()
49 buf->data = (void *)0xdeadbeef; in abuf_done()
[all …]
/openbsd/src/usr.bin/aucat/
Dabuf.c29 abuf_init(struct abuf *buf, unsigned int len) in abuf_init() argument
31 buf->data = xmalloc(len); in abuf_init()
32 buf->len = len; in abuf_init()
33 buf->used = 0; in abuf_init()
34 buf->start = 0; in abuf_init()
38 abuf_done(struct abuf *buf) in abuf_done() argument
41 if (buf->used > 0) in abuf_done()
42 logx(3, "deleting non-empty buffer, used = %d", buf->used); in abuf_done()
44 xfree(buf->data); in abuf_done()
45 buf->data = (void *)0xdeadbeef; in abuf_done()
[all …]
/openbsd/src/sys/arch/sh/sh/
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, bufsiz, addr, DB_FORMAT_N, 1, 0); in disasm_branch()
[all …]
/openbsd/src/sys/sys/
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/usr.sbin/smtpd/
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 …]
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/
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/
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/
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/
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/
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/
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/
Dmidivar.h42 #define MIDIBUF_START(buf) ((buf)->start) argument
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) ((buf)->used >= MIDIBUF_SIZE) argument
47 #define MIDIBUF_ISEMPTY(buf) ((buf)->used == 0) argument
48 #define MIDIBUF_WRITE(buf, byte) \ argument
50 (buf)->data[MIDIBUF_END(buf)] = (byte); \
51 (buf)->used++; \
53 #define MIDIBUF_READ(buf, byte) \ argument
[all …]

12345678910>>...168