Home
last modified time | relevance | path

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

12345678910>>...35

/glibc-2.36/stdio-common/
Dtst-vfprintf-mbs-prec.c102 char buf[200]; in test_mbs_result() local
105 memset (buf, '@', sizeof (buf)); in test_mbs_result()
106 TEST_VERIFY (snprintf (buf, sizeof (buf), "%ls", L"xyz") == 3); in test_mbs_result()
107 TEST_VERIFY (strcmp (buf, "xyz") == 0); in test_mbs_result()
110 memset (buf, '@', sizeof (buf)); in test_mbs_result()
111 TEST_VERIFY (snprintf (buf, sizeof (buf), "%ls", L"x\u00DFz") == 4); in test_mbs_result()
112 TEST_VERIFY (strcmp (buf, "x\xC3\x9Fz") == 0); in test_mbs_result()
115 memset (buf, '@', sizeof (buf)); in test_mbs_result()
116 TEST_VERIFY (snprintf (buf, sizeof (buf), "%.1ls", L"x\u00DFz") == 1); in test_mbs_result()
117 TEST_VERIFY (strcmp (buf, "x") == 0); in test_mbs_result()
[all …]
Dtst-printf.c197 char buf[20]; in do_test() local
200 snprintf (buf, sizeof (buf), "%30s", "foo"), (int) sizeof (buf), in do_test()
201 buf); in do_test()
227 char buf[200]; in do_test() local
229 sprintf(buf,"%*s%*s%*s",-1,"one",-20,"two",-30,"three"); in do_test()
231 result |= strcmp (buf, in do_test()
238 char buf[200]; in do_test() local
240 sprintf (buf, "%07Lo", 040000000000ll); in do_test()
241 printf ("sprintf (buf, \"%%07Lo\", 040000000000ll) = %s", buf); in do_test()
243 if (strcmp (buf, "40000000000") != 0) in do_test()
[all …]
Dtst-vfprintf-width-i18n.c30 char buf[40]; in do_test() local
35 TEST_COMPARE (sprintf (buf, "%7d", 12345), 7); in do_test()
36 TEST_COMPARE_STRING (buf, " 12345"); in do_test()
37 TEST_COMPARE (sprintf (buf, "%10.2f", 12345.67), 10); in do_test()
38 TEST_COMPARE_STRING (buf, " 12345.67"); in do_test()
39 TEST_COMPARE (strfmon (buf, sizeof (buf), "%^13i", 12345.67), 13); in do_test()
40 TEST_COMPARE_STRING (buf, " INR12345.67"); in do_test()
43 TEST_COMPARE (sprintf (buf, "%'8d", 12345), 8); in do_test()
44 TEST_COMPARE_STRING (buf, " 12,345"); in do_test()
45 TEST_COMPARE (sprintf (buf, "%'11.2f", 12345.67), 11); in do_test()
[all …]
Dtst-sprintf-errno.c32 char buf[64]; in do_test() local
35 TEST_COMPARE (sprintf (buf, "%m"), 16); in do_test()
36 TEST_COMPARE_STRING (buf, "Invalid argument"); in do_test()
39 TEST_COMPARE (sprintf (buf, "%#m"), 6); in do_test()
40 TEST_COMPARE_STRING (buf, "EINVAL"); in do_test()
43 TEST_COMPARE (sprintf (buf, "%m"), 7); in do_test()
44 TEST_COMPARE_STRING (buf, "Success"); in do_test()
47 TEST_COMPARE (sprintf (buf, "%#m"), 1); in do_test()
48 TEST_COMPARE_STRING (buf, "0"); in do_test()
52 TEST_COMPARE (sprintf (buf, "%m"), 35); in do_test()
[all …]
Dtstdiomisc.c62 char buf[80]; in t3() local
67 retval = sprintf (buf, "%p", (char *) NULL); in t3()
68 result |= retval != 5 || strcmp (buf, "(nil)") != 0; in t3()
91 char buf[80]; in F() local
105 snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G", in F()
108 result |= strcmp (buf, "nan NAN nan NAN nan NAN nan NAN") != 0; in F()
109 printf ("expected \"nan NAN nan NAN nan NAN nan NAN\", got \"%s\"\n", buf); in F()
111 snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G", in F()
114 result |= strcmp (buf, "-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0; in F()
116 buf); in F()
[all …]
/glibc-2.36/wcsmbs/
Dtest-mbrtoc8.c36 char8_t buf[1] = { 0 }; in test_utf8() local
39 TEST_COMPARE (mbrtoc8 (buf, mbs, 0, &s), (size_t) -2); /* no input */ in test_utf8()
46 char8_t buf[1] = { 0 }; in test_utf8() local
49 TEST_COMPARE (mbrtoc8 (buf, mbs, strlen (mbs) + 1, &s), (size_t) 0); in test_utf8()
51 TEST_COMPARE (buf[0], 0x00); in test_utf8()
59 char8_t buf[1] = { 0 }; in test_utf8() local
62 TEST_COMPARE (mbrtoc8 (buf, mbs, strlen (mbs) + 1, &s), (size_t) 1); in test_utf8()
64 TEST_COMPARE (buf[0], 0x01); in test_utf8()
71 char8_t buf[1] = { 0 }; in test_utf8() local
74 TEST_COMPARE (mbrtoc8 (buf, mbs, strlen (mbs) + 1, &s), (size_t) 1); in test_utf8()
[all …]
Dtest-c8rtomb.c36 char buf[MB_LEN_MAX] = { 0 }; in test_truncated_code_unit_sequence() local
39 TEST_COMPARE (c8rtomb (buf, u8s[0], &s), (size_t) 0); in test_truncated_code_unit_sequence()
41 TEST_COMPARE (c8rtomb (buf, u8s[1], &s), (size_t) -1); in test_truncated_code_unit_sequence()
48 char buf[MB_LEN_MAX] = { 0 }; in test_truncated_code_unit_sequence() local
51 TEST_COMPARE (c8rtomb (buf, u8s[0], &s), (size_t) 0); in test_truncated_code_unit_sequence()
53 TEST_COMPARE (c8rtomb (buf, u8s[1], &s), (size_t) -1); in test_truncated_code_unit_sequence()
60 char buf[MB_LEN_MAX] = { 0 }; in test_truncated_code_unit_sequence() local
63 TEST_COMPARE (c8rtomb (buf, u8s[0], &s), (size_t) 0); in test_truncated_code_unit_sequence()
64 TEST_COMPARE (c8rtomb (buf, u8s[1], &s), (size_t) 0); in test_truncated_code_unit_sequence()
66 TEST_COMPARE (c8rtomb (buf, u8s[2], &s), (size_t) -1); in test_truncated_code_unit_sequence()
[all …]
/glibc-2.36/malloc/
Dtst-alloc_buffer.c52 struct alloc_buffer buf = refbuf; in test_empty_array() local
53 TEST_VERIFY ((alloc_buffer_alloc_bytes (&buf, 0) == NULL) in test_empty_array()
55 TEST_VERIFY (alloc_buffer_has_failed (&buf) == refbuf_failed); in test_empty_array()
58 struct alloc_buffer buf = refbuf; in test_empty_array() local
59 TEST_VERIFY ((alloc_buffer_alloc_array (&buf, char, 0) == NULL) in test_empty_array()
61 TEST_VERIFY (alloc_buffer_has_failed (&buf) == refbuf_failed); in test_empty_array()
66 struct alloc_buffer buf = refbuf; in test_empty_array() local
68 || !IS_ALIGNED (alloc_buffer_next (&buf, void), double); in test_empty_array()
69 double *ptr = alloc_buffer_alloc_array (&buf, double, 0); in test_empty_array()
72 TEST_VERIFY (alloc_buffer_has_failed (&buf) == expect_failure); in test_empty_array()
[all …]
Dtst-scratch_buffer.c28 unchanged_array_size (struct scratch_buffer *buf, size_t a, size_t b) in unchanged_array_size() argument
30 size_t old_length = buf->length; in unchanged_array_size()
31 if (!scratch_buffer_set_array_size (buf, a, b)) in unchanged_array_size()
37 if (old_length != buf->length) in unchanged_array_size()
51 struct scratch_buffer buf; in array_size_must_fail() local
52 scratch_buffer_init (&buf); in array_size_must_fail()
54 if (!scratch_buffer_grow (&buf)) in array_size_must_fail()
59 if (scratch_buffer_set_array_size (&buf, a, b)) in array_size_must_fail()
65 if (buf.data != buf.__space.__c) in array_size_must_fail()
79 struct scratch_buffer buf; in do_test() local
[all …]
/glibc-2.36/sysdeps/unix/sysv/linux/
Dxstatconv.c44 struct stat *buf = ubuf; in __xstat_conv() local
47 buf->st_dev = kbuf->st_dev; in __xstat_conv()
49 buf->__pad1 = 0; in __xstat_conv()
51 buf->st_ino = kbuf->st_ino; in __xstat_conv()
52 buf->st_mode = kbuf->st_mode; in __xstat_conv()
53 buf->st_nlink = kbuf->st_nlink; in __xstat_conv()
54 buf->st_uid = kbuf->st_uid; in __xstat_conv()
55 buf->st_gid = kbuf->st_gid; in __xstat_conv()
56 buf->st_rdev = kbuf->st_rdev; in __xstat_conv()
58 buf->__pad2 = 0; in __xstat_conv()
[all …]
Dinternal_statvfs.c30 __internal_statvfs (struct statvfs *buf, const struct statfs *fsbuf) in __internal_statvfs() argument
33 buf->f_bsize = fsbuf->f_bsize; in __internal_statvfs()
36 buf->f_frsize = fsbuf->f_frsize ?: fsbuf->f_bsize; in __internal_statvfs()
37 buf->f_blocks = fsbuf->f_blocks; in __internal_statvfs()
38 buf->f_bfree = fsbuf->f_bfree; in __internal_statvfs()
39 buf->f_bavail = fsbuf->f_bavail; in __internal_statvfs()
40 buf->f_files = fsbuf->f_files; in __internal_statvfs()
41 buf->f_ffree = fsbuf->f_ffree; in __internal_statvfs()
42 if (sizeof (buf->f_fsid) == sizeof (fsbuf->f_fsid)) in __internal_statvfs()
47 buf->f_fsid = ((fsbuf->f_fsid.__val[0] in __internal_statvfs()
[all …]
/glibc-2.36/sysdeps/unix/sysv/linux/mips/
Dxstatconv.c39 struct stat *buf = ubuf; in __xstat_conv() local
42 buf->st_dev = kbuf->st_dev; in __xstat_conv()
43 memset (&buf->st_pad1, 0, sizeof (buf->st_pad1)); in __xstat_conv()
44 buf->st_ino = kbuf->st_ino; in __xstat_conv()
46 if (buf->st_ino != kbuf->st_ino) in __xstat_conv()
51 buf->st_mode = kbuf->st_mode; in __xstat_conv()
52 buf->st_nlink = kbuf->st_nlink; in __xstat_conv()
53 buf->st_uid = kbuf->st_uid; in __xstat_conv()
54 buf->st_gid = kbuf->st_gid; in __xstat_conv()
55 buf->st_rdev = kbuf->st_rdev; in __xstat_conv()
[all …]
/glibc-2.36/inet/
Dtst-checks.c10 char buf[16]; in do_test() local
11 memset (buf, '\0', 16); in do_test()
13 if (! IN6_IS_ADDR_UNSPECIFIED (buf)) in do_test()
20 buf[i] = 1; in do_test()
21 if (IN6_IS_ADDR_UNSPECIFIED (buf)) in do_test()
27 buf[i] = 0; in do_test()
30 if (IN6_IS_ADDR_LOOPBACK (buf)) in do_test()
35 buf[15] = 1; in do_test()
36 if (! IN6_IS_ADDR_LOOPBACK (buf)) in do_test()
41 buf[15] = 0; in do_test()
[all …]
/glibc-2.36/localedata/
Dtst-wctype.c30 wchar_t buf[1000]; in do_test() local
40 if (fgetws (buf, sizeof (buf) / sizeof (buf[0]), stdin) != NULL) in do_test()
44 wprintf (L"buf[] = \"%ls\"\n", buf); in do_test()
48 for (n = 0; buf[n] != L'\0'; ++n) in do_test()
50 wprintf (L"jhira(U%04lx = %lc) = %d\n", (long) buf[n], buf[n], in do_test()
51 iswctype (buf[n], wct)); in do_test()
52 result |= ((buf[n] < 0xff && iswctype (buf[n], wct)) in do_test()
53 || (buf[n] > 0xff && !iswctype (buf[n], wct))); in do_test()
61 if (fgetws (buf, sizeof (buf) / sizeof (buf[0]), stdin) != NULL) in do_test()
65 wprintf (L"buf[] = \"%ls\"\n", buf); in do_test()
[all …]
/glibc-2.36/sysdeps/unix/sysv/linux/alpha/
Dxstatconv.c37 struct glibc2_stat *buf = ubuf; in __xstat_conv() local
39 buf->st_dev = kbuf->st_dev; in __xstat_conv()
40 buf->st_ino = kbuf->st_ino; in __xstat_conv()
41 buf->st_mode = kbuf->st_mode; in __xstat_conv()
42 buf->st_nlink = kbuf->st_nlink; in __xstat_conv()
43 buf->st_uid = kbuf->st_uid; in __xstat_conv()
44 buf->st_gid = kbuf->st_gid; in __xstat_conv()
45 buf->st_rdev = kbuf->st_rdev; in __xstat_conv()
46 buf->st_size = kbuf->st_size; in __xstat_conv()
47 buf->st_atime_sec = kbuf->st_atime_sec; in __xstat_conv()
[all …]
/glibc-2.36/resolv/
Dns_print.c40 char **buf, size_t *buflen);
43 char **buf, size_t *buflen);
44 static void addlen(size_t len, char **buf, size_t *buflen);
46 char **buf, size_t *buflen);
48 char **buf, size_t *buflen);
69 char *buf, size_t buflen) in ns_sprintrr() argument
76 name_ctx, origin, buf, buflen); in ns_sprintrr()
92 char *buf, size_t buflen) in libresolv_hidden_def()
94 const char *obuf = buf; in libresolv_hidden_def()
107 T(addstr("\t\t\t", 3, &buf, &buflen)); in libresolv_hidden_def()
[all …]
/glibc-2.36/sysdeps/unix/sysv/linux/sparc/sparc64/
Dxstatconv.c39 struct stat *buf = ubuf; in __xstat_conv() local
42 buf->st_dev = kbuf->st_dev; in __xstat_conv()
43 buf->__pad1 = 0; in __xstat_conv()
44 buf->st_ino = kbuf->st_ino; in __xstat_conv()
45 buf->st_mode = kbuf->st_mode; in __xstat_conv()
46 buf->st_nlink = kbuf->st_nlink; in __xstat_conv()
47 buf->st_uid = kbuf->st_uid; in __xstat_conv()
48 buf->st_gid = kbuf->st_gid; in __xstat_conv()
49 buf->st_rdev = kbuf->st_rdev; in __xstat_conv()
50 buf->__pad2 = 0; in __xstat_conv()
[all …]
/glibc-2.36/argp/
Dargp-fmtstream.c73 fs->buf = (char *) malloc (INIT_BUF_SIZE); in __argp_make_fmtstream()
74 if (! fs->buf) in __argp_make_fmtstream()
81 fs->p = fs->buf; in __argp_make_fmtstream()
82 fs->end = fs->buf + INIT_BUF_SIZE; in __argp_make_fmtstream()
100 if (fs->p > fs->buf) in __argp_fmtstream_free()
103 __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); in __argp_fmtstream_free()
105 fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); in __argp_fmtstream_free()
108 free (fs->buf); in __argp_fmtstream_free()
123 char *buf, *nl; in __argp_fmtstream_update() local
127 buf = fs->buf + fs->point_offs; in __argp_fmtstream_update()
[all …]
/glibc-2.36/include/
Dalloc_buffer.h148 alloc_buffer_mark_failed (struct alloc_buffer *buf) in alloc_buffer_mark_failed() argument
150 buf->__alloc_buffer_current = __ALLOC_BUFFER_INVALID_POINTER; in alloc_buffer_mark_failed()
151 buf->__alloc_buffer_end = __ALLOC_BUFFER_INVALID_POINTER; in alloc_buffer_mark_failed()
156 alloc_buffer_size (const struct alloc_buffer *buf) in alloc_buffer_size() argument
158 return buf->__alloc_buffer_end - buf->__alloc_buffer_current; in alloc_buffer_size()
163 alloc_buffer_has_failed (const struct alloc_buffer *buf) in alloc_buffer_has_failed() argument
165 return buf->__alloc_buffer_current == __ALLOC_BUFFER_INVALID_POINTER; in alloc_buffer_has_failed()
171 alloc_buffer_add_byte (struct alloc_buffer *buf, unsigned char b) in alloc_buffer_add_byte() argument
173 if (__glibc_likely (buf->__alloc_buffer_current < buf->__alloc_buffer_end)) in alloc_buffer_add_byte()
175 *(unsigned char *) buf->__alloc_buffer_current = b; in alloc_buffer_add_byte()
[all …]
/glibc-2.36/debug/
Dtst-fortify.c100 char buf[10]; variable
102 #define buf_size sizeof (buf)
144 char *buf = (char *) malloc (buf_size); in do_test() local
167 memcpy (buf, "abcdefghij", 10); in do_test()
168 memmove (buf + 1, buf, 9); in do_test()
169 if (memcmp (buf, "aabcdefghi", 10)) in do_test()
172 memcpy (buf, "abcdefghij", 10); in do_test()
173 bcopy (buf, buf + 1, 9); in do_test()
174 if (memcmp (buf, "aabcdefghi", 10)) in do_test()
177 if (MEMPCPY (buf + 5, "abcde", 5) != buf + 5 + MEMPCPY_RET ("abcde") in do_test()
[all …]
/glibc-2.36/rt/
Dtst-mqueue2.c107 char buf[3]; in do_test() local
117 if (mq_timedreceive (q, buf, 1, NULL, &ts) == 0) in do_test()
130 if (mq_timedreceive (q, buf, 2, NULL, &ts) == 0) in do_test()
143 if (mq_timedreceive (q, buf, 2, NULL, &ts) == 0) in do_test()
162 if (mq_receive (q, buf, 2, NULL) == 0) in do_test()
176 if (mq_timedreceive (q, buf, 2, NULL, &ts) == 0) in do_test()
187 buf[0] = '6'; in do_test()
188 buf[1] = '7'; in do_test()
189 if (mq_send (q, buf, 2, 3) != 0 in do_test()
190 || (buf[0] = '8', mq_send (q, buf, 1, 4) != 0)) in do_test()
[all …]
/glibc-2.36/iconvdata/
Dbug-iconv12.c103 char buf[4]; in do_test() local
124 buf[0] = b0; \ in do_test()
125 buf[1] = b1; \ in do_test()
126 buf[2] = b2; \ in do_test()
127 buf[3] = b3; \ in do_test()
128 fails += run_conversion ("UCS4", "UTF-8", buf, 4, err, line); \ in do_test()
129 fails += run_conversion ("UCS4", "UTF-16LE", buf, 4, err, line); \ in do_test()
130 fails += run_conversion ("UCS4", "UTF-16BE", buf, 4, err, line); \ in do_test()
131 fails += run_conversion ("UCS4", "UTF-32LE", buf, 4, err, line); \ in do_test()
132 fails += run_conversion ("UCS4", "UTF-32BE", buf, 4, err, line); \ in do_test()
[all …]
/glibc-2.36/sysdeps/mach/hurd/
Dstatconv.c23 stat64_conv (struct stat *buf, const struct stat64 *buf64) in stat64_conv() argument
25 if (sizeof *buf == sizeof *buf64 in stat64_conv()
26 && sizeof buf->st_ino == sizeof buf64->st_ino in stat64_conv()
27 && sizeof buf->st_size == sizeof buf64->st_size in stat64_conv()
28 && sizeof buf->st_blocks == sizeof buf64->st_blocks) in stat64_conv()
30 *buf = *(struct stat *) buf64; in stat64_conv()
34 buf->st_fstype = buf64->st_fstype; in stat64_conv()
35 buf->st_fsid = buf64->st_fsid; in stat64_conv()
36 buf->st_ino = buf64->st_ino; in stat64_conv()
37 buf->st_gen = buf64->st_gen; in stat64_conv()
[all …]
/glibc-2.36/stdlib/
Drandom_r.c161 __srandom_r (unsigned int seed, struct random_data *buf) in __srandom_r() argument
170 if (buf == NULL) in __srandom_r()
172 type = buf->rand_type; in __srandom_r()
176 state = buf->state; in __srandom_r()
186 kc = buf->rand_deg; in __srandom_r()
200 buf->fptr = &state[buf->rand_sep]; in __srandom_r()
201 buf->rptr = &state[0]; in __srandom_r()
206 (void) __random_r (buf, &discard); in __srandom_r()
231 struct random_data *buf) in weak_alias()
233 if (buf == NULL) in weak_alias()
[all …]
/glibc-2.36/sunrpc/
Drpc_cmsg.c45 int32_t *buf; in xdr_callmsg() local
58 buf = XDR_INLINE (xdrs, 8 * BYTES_PER_XDR_UNIT in xdr_callmsg()
62 if (buf != NULL) in xdr_callmsg()
64 (void) IXDR_PUT_LONG (buf, cmsg->rm_xid); in xdr_callmsg()
65 (void) IXDR_PUT_ENUM (buf, cmsg->rm_direction); in xdr_callmsg()
68 (void) IXDR_PUT_LONG (buf, cmsg->rm_call.cb_rpcvers); in xdr_callmsg()
71 (void) IXDR_PUT_LONG (buf, cmsg->rm_call.cb_prog); in xdr_callmsg()
72 (void) IXDR_PUT_LONG (buf, cmsg->rm_call.cb_vers); in xdr_callmsg()
73 (void) IXDR_PUT_LONG (buf, cmsg->rm_call.cb_proc); in xdr_callmsg()
75 (void) IXDR_PUT_ENUM (buf, oa->oa_flavor); in xdr_callmsg()
[all …]

12345678910>>...35