Home
last modified time | relevance | path

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

123

/coreutils/gl/lib/
Drandread.c98 } buf; member
132 char *buf = buffer, *buflim = buf + bufsize; in get_nonce() local
133 while (buf < buflim) in get_nonce()
140 size_t max_bytes = MIN (buflim - buf, MAX_GETRANDOM); in get_nonce()
141 ssize_t nbytes = getrandom (buf, max_bytes, 0); in get_nonce()
143 buf += nbytes; in get_nonce()
189 setvbuf (source, s->buf.c, _IOFBF, MIN (sizeof s->buf.c, bytes_bound)); in randread_new()
192 s->buf.isaac.buffered = 0; in randread_new()
193 if (! get_nonce (s->buf.isaac.state.m, in randread_new()
194 MIN (sizeof s->buf.isaac.state.m, bytes_bound))) in randread_new()
[all …]
Drandint.c130 unsigned char buf[sizeof randnum]; in randint_genmax() local
139 randread (source, buf, i); in randint_genmax()
152 randnum = shift_left (randnum) + buf[i]; in randint_genmax()
/coreutils/tests/dd/
Dno-allocate.sh35 local buf="$2"
38 test "$buf" = 'in' && { dd_buf=ibs; }
39 test "$buf" = 'out' && { dd_buf=obs; }
40 test "$buf" = 'both' && { dd_buf=bs; }
59 case "$file$buf" in
70 for buf in 'both' 'in' 'out'; do
71 check_dd_seek_alloc "$file" "$buf" || fail=1
/coreutils/src/
Dforce-link.c51 samedir_template (char const *dstname, char buf[smallsize]) in samedir_template()
57 dsttmp = buf; in samedir_template()
105 char buf[smallsize]; in force_linkat() local
106 char *dsttmp = samedir_template (dstname, buf); in force_linkat()
123 if (dsttmp != buf) in force_linkat()
160 char buf[smallsize]; in force_symlinkat() local
161 char *dsttmp = samedir_template (dstname, buf); in force_symlinkat()
181 if (dsttmp != buf) in force_symlinkat()
Dyes.c101 char *buf = reuse_operand_strings ? *operands : xmalloc (bufalloc); in main() local
108 memcpy (buf + bufused, *operandp, operand_len); in main()
110 buf[bufused++] = ' '; in main()
113 buf[bufused - 1] = '\n'; in main()
120 memcpy (buf + bufused, buf, copysize); in main()
125 while (full_write (STDOUT_FILENO, buf, bufused) == bufused) in main()
Drelpath.c88 relpath (char const *can_fname, char const *can_reldir, char *buf, size_t len) in relpath() argument
110 buf_err |= buffer_or_output ("..", &buf, &len); in relpath()
114 buf_err |= buffer_or_output ("/..", &buf, &len); in relpath()
119 buf_err |= buffer_or_output ("/", &buf, &len); in relpath()
120 buf_err |= buffer_or_output (fname_suffix, &buf, &len); in relpath()
126 &buf, &len); in relpath()
Dpinky.c150 static char buf[INT_STRLEN_BOUND (intmax_t) + sizeof "d"]; in idle_string() local
163 sprintf (buf, "%02d:%02d", hours, minutes); in idle_string()
168 sprintf (buf, "%jdd", days); in idle_string()
170 return buf; in idle_string()
177 static char buf[INT_STRLEN_BOUND (intmax_t) + sizeof "-%m-%d %H:%M"]; in time_string() local
182 strftime (buf, sizeof buf, time_format, tmp); in time_string()
183 return buf; in time_string()
186 return timetostr (utmp_ent->ut_ts.tv_sec, buf); in time_string()
353 char buf[1024]; in print_long_entry() local
366 while ((bytes = fread (buf, 1, sizeof (buf), stream)) > 0) in print_long_entry()
[all …]
Dlibstdbuf.c94 char *buf = nullptr; in apply_mode() local
114 buf = size <= SIZE_MAX ? malloc (size) : nullptr; in apply_mode()
115 if (!buf) in apply_mode()
128 if (setvbuf (stream, buf, setvbuf_mode, size) != 0) in apply_mode()
132 free (buf); in apply_mode()
Dgetlimits.c86 decimal_absval_add_one (char *buf) in decimal_absval_add_one() argument
88 bool negative = (buf[1] == '-'); in decimal_absval_add_one()
89 char *absnum = buf + 1 + negative; in decimal_absval_add_one()
105 char buf[BUFSIZE]; \
106 FTOASTR (buf, sizeof buf, FTOASTR_LEFT_JUSTIFY, 0, x); \
107 puts (buf); \
Dtac-pipe.c61 char *buf = (char *) malloc (BUFFER_SIZE); in buf_init_from_stdin() local
64 if (buf == nullptr) in buf_init_from_stdin()
72 bytes_read = full_read (STDIN_FILENO, buf, BUFFER_SIZE); in buf_init_from_stdin()
78 bp.start = buf; in buf_init_from_stdin()
79 bp.one_past_end = buf + bytes_read; in buf_init_from_stdin()
84 last_byte_is_eol_byte = (buf[bytes_read - 1] == eol_byte); in buf_init_from_stdin()
96 char *buf = malloc (1); in buf_init_from_stdin() local
97 if (buf == nullptr) in buf_init_from_stdin()
105 *buf = eol_byte; in buf_init_from_stdin()
106 bp.start = buf; in buf_init_from_stdin()
[all …]
Dpwd.c34 char *buf; member
78 free (p->buf); in file_name_free()
91 p->buf = xmalloc (p->n_alloc); in file_name_init()
92 p->start = p->buf + (p->n_alloc - 1); in file_name_init()
101 size_t n_free = p->start - p->buf; in file_name_prepend()
112 memcpy (p->start, p->buf + n_free, n_used); in file_name_prepend()
113 free (p->buf); in file_name_prepend()
114 p->buf = q; in file_name_prepend()
127 char *buf = xnmalloc (3, n); in nth_parent() local
128 char *p = buf; in nth_parent()
[all …]
Dsort.c186 char *buf; /* Dynamically allocated buffer, member
1578 initbuf (struct buffer *buf, size_t line_bytes, size_t alloc) in initbuf() argument
1587 buf->buf = malloc (alloc); in initbuf()
1588 if (buf->buf) in initbuf()
1595 buf->line_bytes = line_bytes; in initbuf()
1596 buf->alloc = alloc; in initbuf()
1597 buf->used = buf->left = buf->nlines = 0; in initbuf()
1598 buf->eof = false; in initbuf()
1604 buffer_linelim (struct buffer const *buf) in buffer_linelim() argument
1606 void *linelim = buf->buf + buf->alloc; in buffer_linelim()
[all …]
Dsplit.c280 copy_to_tmpfile (int fd, char *buf, idx_t bufsize) in copy_to_tmpfile() argument
288 while (0 < (r = read (fd, buf, bufsize))) in copy_to_tmpfile()
290 if (fwrite (buf, 1, r, tmp) != r) in copy_to_tmpfile()
315 input_file_size (int fd, struct stat const *st, char *buf, idx_t bufsize) in input_file_size() argument
320 ssize_t n_read = read (fd, buf + size, bufsize - size); in input_file_size()
650 char *buf, idx_t bufsize, ssize_t initial_read, in bytes_split() argument
677 n_read = read (STDIN_FILENO, buf, bufsize); in bytes_split()
682 char *bp_out = buf; in bytes_split()
726 lines_split (intmax_t n_lines, char *buf, idx_t bufsize) in lines_split() argument
735 n_read = read (STDIN_FILENO, buf, bufsize); in lines_split()
[all …]
Dwc.c218 char buf[MAX (INT_BUFSIZE_BOUND (intmax_t), in write_counts() local
223 printf (format_int, number_width, umaxtostr (lines, buf)); in write_counts()
228 printf (format_int, number_width, umaxtostr (words, buf)); in write_counts()
233 printf (format_int, number_width, umaxtostr (chars, buf)); in write_counts()
238 printf (format_int, number_width, umaxtostr (bytes, buf)); in write_counts()
242 printf (format_int, number_width, imaxtostr (linelength, buf)); in write_counts()
265 char buf[BUFFER_SIZE + 1]; in wc_lines() local
266 ssize_t bytes_read = read (fd, buf, BUFFER_SIZE); in wc_lines()
271 char *end = buf + bytes_read; in wc_lines()
277 for (char *p = buf; p < end; p++) in wc_lines()
[all …]
Dtr.c560 char *buf = xmalloc (5); in make_printable_char() local
564 buf[0] = c; in make_printable_char()
565 buf[1] = '\0'; in make_printable_char()
569 sprintf (buf, "\\%03o", c); in make_printable_char()
571 return buf; in make_printable_char()
591 char buf[5]; in make_printable_str() local
624 buf[0] = c; in make_printable_str()
625 buf[1] = '\0'; in make_printable_str()
628 sprintf (buf, "\\%03o", c); in make_printable_str()
629 tmp = buf; in make_printable_str()
[all …]
Dod.c468 char buf[BUFSIZE]; \
469 FTOASTR (buf, sizeof buf, 0, 0, x); \
470 xprintf ("%*s", adjusted_width, buf))
513 char buf[2]; in print_named_ascii() local
521 buf[0] = masked_c; in print_named_ascii()
522 buf[1] = 0; in print_named_ascii()
523 s = buf; in print_named_ascii()
544 char buf[4]; in print_ascii() local
581 sprintf (buf, (isprint (c) ? "%c" : "%03o"), c); in print_ascii()
582 s = buf; in print_ascii()
[all …]
Dseq.c492 char *buf = xmalloc (buf_size); in seq_fast() local
493 char const *buf_end = buf + buf_size; in seq_fast()
495 char *bufp = buf; in seq_fast()
520 size_t buf_offset = bufp - buf; in seq_fast()
522 buf = xrealloc (buf, buf_size); in seq_fast()
523 buf_end = buf + buf_size; in seq_fast()
524 bufp = buf + buf_offset; in seq_fast()
533 if (fwrite (buf, bufp - buf, 1, stdout) != 1) in seq_fast()
535 bufp = buf; in seq_fast()
541 if (fwrite (buf, bufp - buf, 1, stdout) != 1) in seq_fast()
Dls.c2738 char *buf; /* color_buf buffer pointer */ in parse_ls_color() local
2762 buf = color_buf = xstrdup (p); in parse_ls_color()
2788 ext->ext.string = buf; in parse_ls_color()
2790 state = (get_funky_string (&buf, &p, true, &ext->ext.len) in parse_ls_color()
2823 color_indicator[ind_no].string = buf; in parse_ls_color()
2824 state = (get_funky_string (&buf, &p, false, in parse_ls_color()
2838 ext->seq.string = buf; in parse_ls_color()
2839 state = (get_funky_string (&buf, &p, false, &ext->seq.len) in parse_ls_color()
3143 char buf[LONGEST_HUMAN_READABLE + 3]; in print_dir() local
3144 char *p = human_readable (total_blocks, buf + 1, human_output_opts, in print_dir()
[all …]
Ddd.c253 static ssize_t (*iread_fnc) (int fd, char *buf, idx_t size);
1104 iread (int fd, char *buf, idx_t size) in iread() argument
1112 nread = read (fd, buf, size); in iread()
1151 iread_fullblock (int fd, char *buf, idx_t size) in iread_fullblock() argument
1157 ssize_t ncurr = iread (fd, buf, size); in iread_fullblock()
1163 buf += ncurr; in iread_fullblock()
1176 iwrite (int fd, char const *buf, idx_t size) in iwrite() argument
1211 if ((conversions_mask & C_SPARSE) && is_nul (buf, size)) in iwrite()
1226 nwritten = write (fd, buf + total_written, size - total_written); in iwrite()
1729 translate_buffer (char *buf, idx_t nread) in translate_buffer() argument
[all …]
Dwho.c217 static char buf[INT_STRLEN_BOUND (intmax_t) + sizeof "-%m-%d %H:%M"]; in time_string() local
222 strftime (buf, sizeof buf, time_format, tmp); in time_string()
223 return buf; in time_string()
226 return timetostr (utmp_ent->ut_ts.tv_sec, buf); in time_string()
239 char *buf; in print_line() local
263 err = asprintf (&buf, in print_line()
292 char *p = buf + strlen (buf); in print_line()
298 puts (buf); in print_line()
299 free (buf); in print_line()
Dcsplit.c390 free_buffer (struct buffer_record *buf) in free_buffer() argument
392 for (struct line *l = buf->line_start; l;) in free_buffer()
398 free (buf->buffer); in free_buffer()
399 free (buf); in free_buffer()
425 save_buffer (struct buffer_record *buf) in save_buffer() argument
429 buf->next = nullptr; in save_buffer()
430 buf->curr_line = buf->line_start; in save_buffer()
433 head = buf; in save_buffer()
438 p->next = buf; in save_buffer()
671 char buf[INT_BUFSIZE_BOUND (intmax_t)]; in handle_line_error() local
[all …]
Diopoll.c224 fwrite_wait (char const *buf, ssize_t size, FILE *f) in fwrite_wait() argument
228 const size_t written = fwrite (buf, 1, size, f); in fwrite_wait()
237 buf += written; in fwrite_wait()
Dgroup-list.c95 static char buf[INT_BUFSIZE_BOUND (uintmax_t)]; in gidtostr_ptr() local
96 return umaxtostr (*gid, buf); in gidtostr_ptr()
/coreutils/src/blake2/
Dblake2b-ref.c235 memcpy( S->buf + left, in, fill ); /* Fill buffer */ in blake2b_update()
237 blake2b_compress( S, S->buf ); /* Compress */ in blake2b_update()
246 memcpy( S->buf + S->buflen, in, inlen ); in blake2b_update()
265 memset( S->buf + S->buflen, 0, BLAKE2B_BLOCKBYTES - S->buflen ); /* Padding */ in blake2b_final()
266 blake2b_compress( S, S->buf ); in blake2b_final()
323 uint8_t buf[BLAKE2_KAT_LENGTH]; in main() local
330 buf[i] = ( uint8_t )i; in main()
336 blake2b( hash, BLAKE2B_OUTBYTES, buf, i, key, BLAKE2B_KEYBYTES ); in main()
349 uint8_t * p = buf; in main()
/coreutils/tests/split/
Dfilter.sh75 for buf in 1000 1000000; do
77 "yes | split --filter='head -c1 >/dev/null' -b $buf" || fail=1

123