Home
last modified time | relevance | path

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

1234567

/picolibc-latest/newlib/libc/time/
Dstrptime.c75 match_string (const char *__restrict *buf, const char * const*strs, in match_string() argument
83 if (strncasecmp_l (*buf, strs[i], len, locale) == 0) { in match_string()
84 *buf += len; in match_string()
157 strptime_l (const char *buf, const char *format, struct tm *timeptr, in strptime_l() argument
169 while (isspace_l ((unsigned char) *buf, locale)) in strptime_l()
170 ++buf; in strptime_l()
177 ret = match_string (&buf, _ctloc (weekday), locale); in strptime_l()
184 ret = match_string (&buf, _ctloc (wday), locale); in strptime_l()
191 ret = match_string (&buf, _ctloc (month), locale); in strptime_l()
199 ret = match_string (&buf, _ctloc (mon), locale); in strptime_l()
[all …]
/picolibc-latest/test/
Dtest-long-long.c47 naive_atou(const char *buf)
53 while ((c = *buf++) == ' ')
58 c = *buf++;
64 naive_atol(const char *buf)
70 while ((c = *buf++) == ' ')
75 c = *buf++;
79 c = *buf++;
85 c = *buf++;
92 naive_utoa(char *buf, unsigned long long v) in naive_utoa() argument
94 buf += 21; in naive_utoa()
[all …]
Dtest-memmove_s.c104 char buf[50] = "Hello, world!"; in main() local
113 res = memmove_s(buf + 7, sizeof(buf) - 7, buf, strlen(buf) + 1); in main()
116 TEST_RES(strcmp(buf, "Hello, Hello, world!") == 0, "Normal move Contents", in main()
121 res = memmove_s(buf + 7, 5, buf, strlen(buf) + 1); in main()
129 res = memmove_s(NULL, sizeof(buf), buf, strlen(buf) + 1); in main()
135 res = memmove_s(buf, sizeof(buf), NULL, strlen(buf) + 1); in main()
141 strcpy(buf, ""); in main()
142 res = memmove_s(buf, sizeof(buf), buf, 0); in main()
145 TEST_RES(buf[0] == '\0', "Move with zero length Contents", handler_res, in main()
Dtest-efcvt.c63 #define ecvt_r(n, dig, dec, sign, buf, len) (ecvtbuf(n, dig, dec, sign, buf) ? 0 : -1) argument
64 #define fcvt_r(n, dig, dec, sign, buf, len) (fcvtbuf(n, dig, dec, sign, buf) ? 0 : -1) argument
65 #define ecvtf_r(n, dig, dec, sign, buf, len) (ecvtbuf(n, dig, dec, sign, buf) ? 0 : -1) argument
66 #define fcvtf_r(n, dig, dec, sign, buf, len) (fcvtbuf(n, dig, dec, sign, buf) ? 0 : -1) argument
178 int ret = func(tests[i].value, tests[i].ndigit, &decpt, &sign, buf, sizeof(buf)); \
184 if (skip_long && strlen(buf) > 6) { \
185 printf("skipping test as result is long (%s)\n", buf); \
188 if (strcmp(buf, tests[i].expect) != 0 || \
193 i, buf, decpt, sign, \
205 static char buf[2048]; in main() local
Dtest-sprintf_s.c104 char buf[50]; in main() local
113 res = sprintf_s(buf, sizeof(buf), "Hello, %s!", "world"); in main()
117 TEST_RES(strcmp(buf, "Hello, world!") == 0, "Normal formatting Contents", in main()
122 res = sprintf_s(buf, 10, "Hello, %s!", "world"); in main()
129 res = sprintf_s(NULL, sizeof(buf), "Hello, %s!", "world"); in main()
136 res = sprintf_s(buf, sizeof(buf), NULL, "world"); in main()
144 res = sprintf_s(buf, sizeof(buf), "", "world"); in main()
147 TEST_RES(strcmp(buf, "") == 0, "Empty format string Contents", handler_res, in main()
Dprintf_scanf.c254 check_float(const char *test_name, float_type a, const char *buf, const char *head, int zeros, cons… in check_float() argument
259 if (strncmp(buf, head, strlen(head)) != 0) in check_float()
264 if (buf[o] != '0') in check_float()
269 if (strcmp(buf + o, tail) != 0) in check_float()
275 test_name, printf_float(a), printf_float(a), buf, head, zeros, tail); in check_float()
287 char buf[256]; in main() local
352 sprintf(buf, "%g", printf_float(0.0f)); in main()
353 if (strcmp(buf, "0") != 0) { in main()
354 printf("0: wanted \"0\" got \"%s\"\n", buf); in main()
397 strncpy(buf, "123", y - 1); in main()
[all …]
Dtest-memset_s.c104 char buf[50] = "Hello, world!"; in main() local
113 res = memset_s(buf, sizeof(buf), 'A', strlen("Hello, world!")); in main()
116 TEST_RES(strcmp(buf, "AAAAAAAAAAAAA") == 0, "Normal Set Contents", in main()
121 res = memset_s(buf, sizeof(buf), 'B', 0); in main()
124 TEST_RES(strcmp(buf, "AAAAAAAAAAAAA") == 0, "Zero-length Set Contents", in main()
129 res = memset_s(NULL, sizeof(buf), 'C', strlen("Hello, world!")); in main()
135 res = memset_s(buf, 0, 'D', strlen("Hello, world!")); in main()
/picolibc-latest/newlib/libc/sys/amdgcn/
Dlock.c56 char buf[1000]; in __gcn_lock_acquire_int() local
57 __builtin_sprintf (buf,"acquire:%p(%d) lock_value:0x%x id:0x%x", lock_ptr, in __gcn_lock_acquire_int()
59 write (1, buf, __builtin_strlen(buf)); in __gcn_lock_acquire_int()
77 __builtin_sprintf (buf,"acquired:%p(%d) lock_value:0x%x id:0x%x", lock_ptr, in __gcn_lock_acquire_int()
79 write (1, buf, __builtin_strlen(buf)); in __gcn_lock_acquire_int()
103 char buf[1000]; in __gcn_lock_acquire_recursive_int() local
104 __builtin_sprintf (buf,"acquire recursive:%p(%d) lock_value:0x%x id:0x%x", in __gcn_lock_acquire_recursive_int()
106 write (1, buf, __builtin_strlen(buf)); in __gcn_lock_acquire_recursive_int()
119 __builtin_sprintf (buf, in __gcn_lock_acquire_recursive_int()
122 write (1, buf, __builtin_strlen(buf)); in __gcn_lock_acquire_recursive_int()
[all …]
/picolibc-latest/newlib/libc/stdlib/
Decvtbuf.c73 char *buf, in print_e() argument
88 buf[0] = '\0'; in print_e()
94 strcpy (buf, p); in print_e()
98 *buf++ = *p++; in print_e()
105 *buf++ = '.'; in print_e()
108 *buf++ = *p++; in print_e()
124 *buf++ = '.'; in print_e()
127 *buf++ = '0'; in print_e()
134 *buf++ = type; in print_e()
138 *buf++ = '-'; in print_e()
[all …]
Dwcstod.c153 char *buf, *end; in wcstod_l() local
178 if ((buf = malloc(len + 1)) == NULL) in wcstod_l()
181 _wcsnrtombs_l(buf, &wcp, (size_t) -1, len + 1, &mbs, loc); in wcstod_l()
184 val = strtod_l(buf, &end, loc); in wcstod_l()
206 char *d = strstr (buf, decimal_point); in wcstod_l()
210 *endptr = (wchar_t *)nptr + (end - buf); in wcstod_l()
213 free(buf); in wcstod_l()
225 char *buf, *end; in wcstof_l() local
250 if ((buf = malloc(len + 1)) == NULL) in wcstof_l()
253 _wcsnrtombs_l(buf, &wcp, (size_t) -1, len + 1, &mbs, loc); in wcstof_l()
[all …]
Defgcvt.c132 char *buf) in gcvt() argument
134 char *tbuf = buf; in gcvt()
136 *buf = '-'; in gcvt()
137 buf++; in gcvt()
140 return (_gcvt (d, ndigit, buf, 'g', 0) ? tbuf : 0); in gcvt()
147 char *buf) in gcvtf() argument
150 return gcvt (asd, ndigit, buf); in gcvtf()
/picolibc-latest/newlib/libc/stdio/
Dgetdelim.c49 char *buf; in __getdelim() local
62 buf = *bufptr; in __getdelim()
63 if (buf == NULL || *n < MIN_LINE_SIZE) in __getdelim()
65 buf = (char *)realloc (*bufptr, DEFAULT_LINE_SIZE); in __getdelim()
66 if (buf == NULL) in __getdelim()
70 *bufptr = buf; in __getdelim()
79 ptr = buf; in __getdelim()
107 pos = ptr - buf; in __getdelim()
109 buf = realloc (buf, newsize); in __getdelim()
110 if (buf == NULL) in __getdelim()
[all …]
Dfmemopen.c75 char *buf; /* buffer start */ member
89 char *buf, in fmemreader() argument
98 memcpy (buf, c->buf + c->pos, n); in fmemreader()
108 const char *buf, in fmemwriter() argument
119 memset (c->buf + c->eof, '\0', c->pos - c->eof); in fmemwriter()
135 c->saved = c->buf[c->eof - adjust] = '\0'; in fmemwriter()
141 c->saved = c->buf[c->pos + n - adjust]; in fmemwriter()
142 c->buf[c->pos + n - adjust] = '\0'; in fmemwriter()
149 memcpy (c->buf + c->pos - n, buf, n - adjust); in fmemwriter()
198 c->buf[c->pos] = c->saved; in fmemseeker()
[all …]
/picolibc-latest/newlib/libc/include/rpc/
Dxdr.h268 #define IXDR_GET_INT32(buf) ((int32_t)ntohl((u_int32_t)*(buf)++)) argument
269 #define IXDR_PUT_INT32(buf, v) (*(buf)++ =(int32_t)htonl((u_int32_t)v)) argument
270 #define IXDR_GET_U_INT32(buf) ((uint32_t)IXDR_GET_INT32(buf)) argument
271 #define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32((buf), ((int32_t)(v))) argument
277 #define IXDR_GET_LONG(buf) ((long)ntohl((u_int32_t)*(buf)++)) argument
278 #define IXDR_PUT_LONG(buf, v) (*(buf)++ =(int32_t)htonl((u_int32_t)v)) argument
279 #define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf)) argument
280 #define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), (v)) argument
282 #define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf)) argument
283 #define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf)) argument
[all …]
/picolibc-latest/newlib/libc/machine/cris/
Dsetjmp.c62 setjmp (jmp_buf buf) in setjmp() argument
100 : "r" (buf) in setjmp()
122 : "r" (buf) in setjmp()
142 : "r" (buf) in setjmp()
152 longjmp(jmp_buf buf, int val) in longjmp() argument
193 : "r" (buf), "r" (val) in longjmp()
211 : "r" (buf), "r" (val) in longjmp()
/picolibc-latest/newlib/libc/tinystdio/
Dbufio.c42 char *buf; in __bufio_flush_locked() local
48 buf = bf->buf; in __bufio_flush_locked()
50 ssize_t this = bufio_write(bf, buf, bf->len); in __bufio_flush_locked()
84 len = bufio_read (bf, bf->buf, bf->size); in __bufio_fill_locked()
137 bf->buf[bf->len++] = c; in __bufio_put()
194 ret = (unsigned char) bf->buf[bf->off++]; in __bufio_get()
242 __bufio_setvbuf(FILE *f, char *buf, int mode, size_t size) in __bufio_setvbuf() argument
251 buf = NULL; in __bufio_setvbuf()
263 if (buf) { in __bufio_setvbuf()
264 free(bf->buf); in __bufio_setvbuf()
[all …]
Dfcvtl_r.c47 char *buf, in fcvtl_r() argument
129 memcpy(buf, digits, ndigit); in fcvtl_r()
130 buf += ndigit; in fcvtl_r()
133 memset(buf, '0', ntrailing); in fcvtl_r()
134 buf += ntrailing; in fcvtl_r()
137 buf[0] = '\0'; in fcvtl_r()
150 char *buf, in fcvtl_r() argument
153 return fcvtf_r((float) invalue, ndecimal, decpt, sign, buf, len); in fcvtl_r()
165 char *buf, in fcvtl_r() argument
168 return fcvt_r((double) invalue, ndecimal, decpt, sign, buf, len); in fcvtl_r()
Dfmemopen.c43 char *buf; member
58 mf->buf[pos++] = c; in __fmem_put()
66 mf->buf[mf->size] = '\0'; in __fmem_put()
83 return (unsigned char)mf->buf[mf->pos++]; in __fmem_get()
94 mf->buf[mf->pos] = '\0'; in __fmem_flush()
130 free(mf->buf); in __fmem_close()
138 fmemopen(void *buf, size_t size, const char *mode) in fmemopen() argument
159 if (buf == NULL) { in fmemopen()
167 buf = malloc(size); in fmemopen()
168 if (!buf) { in fmemopen()
[all …]
Dfcvt_r.c47 char *buf, in fcvt_r() argument
123 memcpy(buf, digits, ndigit); in fcvt_r()
124 buf += ndigit; in fcvt_r()
127 memset(buf, '0', ntrailing); in fcvt_r()
128 buf += ntrailing; in fcvt_r()
131 buf[0] = '\0'; in fcvt_r()
144 char *buf, in fcvt_r() argument
147 return fcvtf_r((float) invalue, ndecimal, decpt, sign, buf, len); in fcvt_r()
Decvtl_r.c47 char *buf, in ecvtl_r() argument
82 memset(buf, '0', ndigit); in ecvtl_r()
83 memcpy(buf, digits, ngot); in ecvtl_r()
84 buf[ndigit] = '\0'; in ecvtl_r()
97 char *buf, in ecvtl_r() argument
100 return ecvtf_r((float) invalue, ndigit, decpt, sign, buf, len); in ecvtl_r()
112 char *buf, in ecvtl_r() argument
115 return ecvt_r((double) invalue, ndigit, decpt, sign, buf, len); in ecvtl_r()
/picolibc-latest/test/semihost/
Dsemihost-read.c52 char buf[TEST_STRING_LEN + 10]; in main() local
78 not_read = sys_semihost_read(fd, buf, sizeof(buf)); in main()
79 if (not_read + TEST_STRING_LEN != sizeof(buf)) { in main()
80 …printf("read bad result %ld expected %ld\n", (long) not_read, (long) (sizeof(buf) - TEST_STRING_LE… in main()
84 buf[TEST_STRING_LEN] = '\0'; in main()
85 if (memcmp(buf, TEST_STRING, TEST_STRING_LEN) != 0) { in main()
86 printf("read bad contents %s expected %s\n", buf, TEST_STRING); in main()
Dsemihost-write.c52 char buf[TEST_STRING_LEN + 10]; in main() local
78 not_read = sys_semihost_read(fd, buf, sizeof(buf)); in main()
79 if (not_read + TEST_STRING_LEN != sizeof(buf)) { in main()
80 …printf("read bad result %ld expected %ld\n", (long) not_read, (long) (sizeof(buf) - TEST_STRING_LE… in main()
84 buf[TEST_STRING_LEN] = '\0'; in main()
85 if (memcmp(buf, TEST_STRING, TEST_STRING_LEN) != 0) { in main()
86 printf("read bad contents %s expected %s\n", buf, TEST_STRING); in main()
Dsemihost-seek.c53 char buf[TEST_STRING_LEN + 10]; in main() local
88 not_read = sys_semihost_read(fd, buf, sizeof(buf)); in main()
89 if (sizeof (buf) - not_read != TEST_STRING_LEN - TEST_SEEK_POS) { in main()
91 (long) (sizeof(buf) - TEST_STRING_LEN + TEST_SEEK_POS)); in main()
95 buf[TEST_STRING_LEN - TEST_SEEK_POS] = '\0'; in main()
96 if (memcmp(buf, &TEST_STRING[0] + TEST_SEEK_POS, TEST_STRING_LEN - TEST_SEEK_POS) != 0) { in main()
98 buf, &TEST_STRING[0] + TEST_SEEK_POS); in main()
/picolibc-latest/semihost/
Dtimes.c41 times(struct tms *buf) in times() argument
43 buf->tms_stime = buf->tms_cstime = buf->tms_cutime = 0; in times()
44 return buf->tms_utime = (clock_t) sys_semihost_elapsed(); in times()
/picolibc-latest/newlib/libc/string/
Dstrerror_s.c43 strerror_s(char *buf, rsize_t buflen, __errno_t errnum) in strerror_s() argument
48 if (buf == NULL) { in strerror_s()
62 (void)strncpy(buf, cp, MAX_ERROR_MSG); in strerror_s()
66 (void)memcpy(buf, cp, (buflen - 1u)); in strerror_s()
67 buf[(buflen - 1u)] = '\0'; in strerror_s()
70 (void)strncpy(&buf[(buflen - 4u)], "...", 4u); in strerror_s()

1234567