| /NextBSD/contrib/libarchive/libarchive/test/ |
| HD | test_read_format_rar.c | 33 char buff[64]; in DEFINE_TEST() local 54 assertA(size == archive_read_data(a, buff, size)); in DEFINE_TEST() 55 assertEqualMem(buff, test_txt, size); in DEFINE_TEST() 66 assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() 76 assertA(size == archive_read_data(a, buff, size)); in DEFINE_TEST() 77 assertEqualMem(buff, test_txt, size); in DEFINE_TEST() 106 char buff[64]; in DEFINE_TEST() local 127 assertA(size == archive_read_data(a, buff, size)); in DEFINE_TEST() 128 assertEqualMem(buff, test_txt, size); in DEFINE_TEST() 139 char buff[64]; in DEFINE_TEST() local [all …]
|
| HD | test_write_disk_sparse.c | 41 char *buff, *p; in verify_write_data() local 45 buff = malloc(buff_size); in verify_write_data() 46 assert(buff != NULL); in verify_write_data() 47 if (buff == NULL) in verify_write_data() 60 memset(buff, 0, buff_size); in verify_write_data() 61 memcpy(buff, data, sizeof(data)); in verify_write_data() 63 assertEqualInt(buff_size, archive_write_data(a, buff, buff_size)); in verify_write_data() 66 memset(buff, 0, buff_size); in verify_write_data() 67 memcpy(buff + buff_size / 2 - 3, data, sizeof(data)); in verify_write_data() 69 assertEqualInt(buff_size, archive_write_data(a, buff, buff_size)); in verify_write_data() [all …]
|
| HD | test_zip_filename_encoding.c | 35 char buff[4096]; in test_zip_filename_encoding_UTF8() local 56 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_zip_filename_encoding_UTF8() 69 assertEqualInt(0x08, buff[7]); in test_zip_filename_encoding_UTF8() 70 assertEqualMem(buff + 30, "\xD0\xBF\xD1\x80\xD0\xB8", 6); in test_zip_filename_encoding_UTF8() 79 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_zip_filename_encoding_UTF8() 92 assertEqualInt(0x08, buff[7]); in test_zip_filename_encoding_UTF8() 93 assertEqualMem(buff + 30, "\xD0\xBF\xD1\x80\xD0\xB8", 6); in test_zip_filename_encoding_UTF8() 102 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_zip_filename_encoding_UTF8() 115 assertEqualInt(0, buff[7]); in test_zip_filename_encoding_UTF8() 116 assertEqualMem(buff + 30, "abcABC", 6); in test_zip_filename_encoding_UTF8() [all …]
|
| HD | test_write_format_iso9660_boot.c | 95 unsigned char *buff; in _test_write_format_iso9660_boot() local 101 buff = malloc(buffsize); in _test_write_format_iso9660_boot() 102 assert(buff != NULL); in _test_write_format_iso9660_boot() 112 assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); in _test_write_format_iso9660_boot() 138 assertEqualMem(buff+i, nullb, 2048); in _test_write_format_iso9660_boot() 143 assertEqualMem(buff+2048*16, primary_id, 8); in _test_write_format_iso9660_boot() 144 assertEqualMem(buff+2048*16+0x28, in _test_write_format_iso9660_boot() 146 assertEqualMem(buff+2048*16+0x50, volumesize, 8); in _test_write_format_iso9660_boot() 150 assertEqualMem(buff+2048*17, boot_id, sizeof(boot_id)); in _test_write_format_iso9660_boot() 153 assert(buff[2048*17+i] == 0); in _test_write_format_iso9660_boot() [all …]
|
| HD | test_ustar_filename_encoding.c | 35 char buff[4096]; in test_ustar_filename_encoding_UTF8_CP866() local 56 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_ustar_filename_encoding_UTF8_CP866() 69 assertEqualMem(buff, "\xAF\xE0\xA8", 3); in test_ustar_filename_encoding_UTF8_CP866() 77 char buff[4096]; in test_ustar_filename_encoding_KOI8R_UTF8() local 98 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_ustar_filename_encoding_KOI8R_UTF8() 111 assertEqualMem(buff, "\xD0\xBF\xD1\x80\xD0\xB8", 6); in test_ustar_filename_encoding_KOI8R_UTF8() 119 char buff[4096]; in test_ustar_filename_encoding_KOI8R_CP866() local 140 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_ustar_filename_encoding_KOI8R_CP866() 153 assertEqualMem(buff, "\xAF\xE0\xA8", 3); in test_ustar_filename_encoding_KOI8R_CP866() 161 char buff[4096]; in test_ustar_filename_encoding_CP1251_UTF8() local [all …]
|
| HD | test_gnutar_filename_encoding.c | 35 char buff[4096]; in test_gnutar_filename_encoding_UTF8_CP866() local 56 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_gnutar_filename_encoding_UTF8_CP866() 69 assertEqualMem(buff, "\xAF\xE0\xA8", 3); in test_gnutar_filename_encoding_UTF8_CP866() 77 char buff[4096]; in test_gnutar_filename_encoding_KOI8R_UTF8() local 98 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_gnutar_filename_encoding_KOI8R_UTF8() 111 assertEqualMem(buff, "\xD0\xBF\xD1\x80\xD0\xB8", 6); in test_gnutar_filename_encoding_KOI8R_UTF8() 119 char buff[4096]; in test_gnutar_filename_encoding_KOI8R_CP866() local 140 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_gnutar_filename_encoding_KOI8R_CP866() 153 assertEqualMem(buff, "\xAF\xE0\xA8", 3); in test_gnutar_filename_encoding_KOI8R_CP866() 161 char buff[4096]; in test_gnutar_filename_encoding_CP1251_UTF8() local [all …]
|
| HD | test_write_format_iso9660_zisofs.c | 100 unsigned char *buff; in test_write_format_iso9660_zisofs_1() local 107 buff = malloc(buffsize); in test_write_format_iso9660_zisofs_1() 108 assert(buff != NULL); in test_write_format_iso9660_zisofs_1() 109 if (buff == NULL) in test_write_format_iso9660_zisofs_1() 120 free(buff); in test_write_format_iso9660_zisofs_1() 124 assertEqualIntA(a, 0, archive_write_open_memory(a, buff, buffsize, &used)); in test_write_format_iso9660_zisofs_1() 197 assertEqualInt(buff[i], 0); in test_write_format_iso9660_zisofs_1() 202 assertEqualMem(buff+2048*16, primary_id, 8); in test_write_format_iso9660_zisofs_1() 203 assertEqualMem(buff+2048*16+0x28, in test_write_format_iso9660_zisofs_1() 205 assertEqualMem(buff+2048*16+0x50, volumesize, 8); in test_write_format_iso9660_zisofs_1() [all …]
|
| HD | test_read_format_7zip.c | 38 char buff[128]; in test_copy() local 53 assertEqualInt(60, archive_read_data(a, buff, sizeof(buff))); in test_copy() 54 assertEqualMem(buff, " ", 4); in test_copy() 149 char buff[128]; in test_plain_header() local 164 assertEqualInt(sizeof(buff), archive_read_data(a, buff, sizeof(buff))); in test_plain_header() 165 assertEqualMem(buff, "The libarchive distribution ", 28); in test_plain_header() 190 char buff[128]; in test_extract_all_files() local 205 assertEqualInt(13, archive_read_data(a, buff, sizeof(buff))); in test_extract_all_files() 206 assertEqualMem(buff, "aaaaaaaaaaaa\n", 13); in test_extract_all_files() 214 assertEqualInt(26, archive_read_data(a, buff, sizeof(buff))); in test_extract_all_files() [all …]
|
| HD | test_write_format_iso9660_empty.c | 54 unsigned char *buff; in DEFINE_TEST() local 59 buff = malloc(buffsize); in DEFINE_TEST() 60 assert(buff != NULL); in DEFINE_TEST() 61 if (buff == NULL) in DEFINE_TEST() 70 assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); in DEFINE_TEST() 140 assert(buff[i] == 0); in DEFINE_TEST() 145 assertEqualMem(buff+2048*16, primary_id, 8); in DEFINE_TEST() 146 assertEqualMem(buff+2048*16+0x28, in DEFINE_TEST() 148 assertEqualMem(buff+2048*16+0x50, volumesize, 8); in DEFINE_TEST() 153 assertEqualMem(buff+2048*17, supplementary_id, 8); in DEFINE_TEST() [all …]
|
| HD | test_tar_large.c | 55 void *buff; member 65 void *buff; member 77 static ssize_t memory_read(struct archive *, void *, const void **buff); 82 memory_write(struct archive *a, void *_private, const void *buff, size_t size) in memory_write() argument 96 if ((const char *)filedata <= (const char *)buff in memory_write() 97 && (const char *)buff < (const char *)filedata + filedatasize) { in memory_write() 106 block->buff = malloc(size); in memory_write() 107 memcpy(block->buff, buff, size); in memory_write() 120 memory_read(struct archive *a, void *_private, const void **buff) in memory_read() argument 128 free(private->buff); in memory_read() [all …]
|
| HD | test_write_format_iso9660_filename.c | 141 verify(unsigned char *buff, size_t used, enum vtype type, struct fns *fns) in verify() argument 159 assertEqualIntA(a, 0, archive_read_open_memory(a, buff, used)); in verify() 201 create_iso_image(unsigned char *buff, size_t buffsize, size_t *used, in create_iso_image() argument 227 assertA(0 == archive_write_open_memory(a, buff, buffsize, used)); in create_iso_image() 307 unsigned char *buff; in DEFINE_TEST() local 313 buff = malloc(buffsize); in DEFINE_TEST() 314 assert(buff != NULL); in DEFINE_TEST() 315 if (buff == NULL) in DEFINE_TEST() 322 fcnt = create_iso_image(buff, buffsize, &used, NULL); in DEFINE_TEST() 327 free(buff); in DEFINE_TEST() [all …]
|
| HD | test_pax_filename_encoding.c | 94 char buff[65536]; in test_pax_filename_encoding_2() local 121 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_pax_filename_encoding_2() 162 assertEqualInt(0, archive_read_open_memory(a, buff, used)); in test_pax_filename_encoding_2() 197 char buff[65536]; 211 if (wctomb(buff, 0x1234) > 0) { 218 if (wctomb(buff, 0x1234) > 0) { 240 archive_write_open_memory(a, buff, sizeof(buff), &used)); 290 assertEqualInt(0, archive_read_open_memory(a, buff, used)); 343 char buff[4096]; in test_pax_filename_encoding_KOI8R() local 367 archive_write_open_memory(a, buff, sizeof(buff), &used)); in test_pax_filename_encoding_KOI8R() [all …]
|
| HD | test_archive_read_multiple_data_objects.c | 45 char buff[64]; in test_splitted_file() local 73 assertA(size == archive_read_data(a, buff, size)); in test_splitted_file() 74 assertEqualMem(buff, test_txt, size); in test_splitted_file() 85 assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff))); in test_splitted_file() 95 assertA(size == archive_read_data(a, buff, size)); in test_splitted_file() 96 assertEqualMem(buff, test_txt, size); in test_splitted_file() 137 char buff[64]; in test_large_splitted_file() local 156 while (offset + (int)sizeof(buff) < size) in test_large_splitted_file() 158 assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); in test_large_splitted_file() 159 offset += sizeof(buff); in test_large_splitted_file() [all …]
|
| HD | test_sparse_basic.c | 101 char buff[1024]; in create_sparse_file() local 105 memset(buff, ' ', sizeof(buff)); in create_sparse_file() 126 if (size > sizeof(buff)) in create_sparse_file() 127 w = sizeof(buff); in create_sparse_file() 130 assert(WriteFile(handle, buff, w, &wr, NULL) != 0); in create_sparse_file() 172 char buff[1024]; in is_sparse_supported() local 176 memset(buff, 0, sizeof(buff)); in is_sparse_supported() 181 fm = (struct fiemap *)buff; in is_sparse_supported() 185 fm->fm_extent_count = (sizeof(buff) - sizeof(*fm))/ in is_sparse_supported() 216 char buff[1024]; in create_sparse_file() local [all …]
|
| HD | test_read_filter_uudecode.c | 77 char *buff; in test_read_uu_sub() local 94 assert(NULL != (buff = malloc(uusize + 1024 * 1024))); in test_read_uu_sub() 95 if (buff == NULL) in test_read_uu_sub() 98 char *p = buff; in test_read_uu_sub() 125 read_open_memory(a, buff, size, 2)); in test_read_uu_sub() 146 buff[extra + 1024] = buff[extra]; in test_read_uu_sub() 147 buff[size - 1] = '\n'; in test_read_uu_sub() 148 memcpy(buff + size, uudata, uusize); in test_read_uu_sub() 156 read_open_memory(a, buff, size, 2)); in test_read_uu_sub() 159 free(buff); in test_read_uu_sub()
|
| HD | test_read_format_cab.c | 188 char buff[128]; in verify() local 219 for (s = 0; s + sizeof(buff) < 33000; s+= sizeof(buff)) { in verify() 220 ssize_t rsize = archive_read_data(a, buff, sizeof(buff)); in verify() 226 assertEqualInt(sizeof(buff), rsize); in verify() 227 assertEqualMem(buff, zero, sizeof(buff)); in verify() 229 assertEqualInt(33000 - s, archive_read_data(a, buff, 33000 - s)); in verify() 230 assertEqualMem(buff, zero, 33000 - s); in verify() 240 assertEqualInt(file1_size, archive_read_data(a, buff, file1_size)); in verify() 241 assertEqualMem(buff, file1, file1_size); in verify() 250 assertEqualInt(file2_size, archive_read_data(a, buff, file2_size)); in verify() [all …]
|
| /NextBSD/contrib/libarchive/tar/test/ |
| HD | test_print_longpath.c | 31 char buff[2048]; in DEFINE_TEST() local 38 memset(buff, 0, sizeof(buff)); in DEFINE_TEST() 42 strncat(buff, "0123456789", in DEFINE_TEST() 43 sizeof(buff) - strlen(buff) -1); in DEFINE_TEST() 44 strncat(buff, "/", sizeof(buff) - strlen(buff) -1); in DEFINE_TEST() 46 strncat(buff, "\n", sizeof(buff) - strlen(buff) -1); in DEFINE_TEST() 48 buff[sizeof(buff)-1] = '\0'; in DEFINE_TEST() 52 assertTextFileContents(buff, "test.out"); in DEFINE_TEST()
|
| HD | test_copy.c | 109 char buff[250]; in compute_filenames() local 118 buff[j] = 'a' + (j % 26); in compute_filenames() 119 buff[j--] = '\0'; in compute_filenames() 121 buff[j--] = '0' + (i % 10); in compute_filenames() 123 buff[j--] = '0' + ((i / 10) % 10); in compute_filenames() 125 buff[j--] = '0' + (char)(i / 100); in compute_filenames() 127 buff[j] = '_'; in compute_filenames() 129 assertEqualInt(strlen(buff), i); in compute_filenames() 130 filenames[i] = strdup(buff); in compute_filenames() 137 char buff[260]; in create_tree() local [all …]
|
| /NextBSD/contrib/compiler-rt/lib/sanitizer_common/ |
| HD | sanitizer_printf.cc | 34 static int AppendChar(char **buff, const char *buff_end, char c) { in AppendChar() argument 35 if (*buff < buff_end) { in AppendChar() 36 **buff = c; in AppendChar() 37 (*buff)++; in AppendChar() 45 static int AppendNumber(char **buff, const char *buff_end, u64 absolute_value, in AppendNumber() argument 57 result += AppendChar(buff, buff_end, '-'); in AppendNumber() 75 result += AppendChar(buff, buff_end, c); in AppendNumber() 77 if (negative && !pad_with_zero) result += AppendChar(buff, buff_end, '-'); in AppendNumber() 80 result += AppendChar(buff, buff_end, (digit < 10) ? '0' + digit in AppendNumber() 86 static int AppendUnsigned(char **buff, const char *buff_end, u64 num, u8 base, in AppendUnsigned() argument [all …]
|
| /NextBSD/usr.sbin/ppp/ |
| HD | auth.c | 168 char *vector[6], buff[LINE_LEN]; in auth_SetPhoneList() local 175 while (fgets(buff, sizeof buff, fp)) { in auth_SetPhoneList() 177 if (buff[0] == '#') in auth_SetPhoneList() 179 buff[strlen(buff) - 1] = '\0'; in auth_SetPhoneList() 181 if ((n = MakeArgs(buff, vector, VECSIZE(vector), PARSE_REDUCE)) < 0) in auth_SetPhoneList() 213 char *vector[5], buff[LINE_LEN]; in auth_Select() local 236 while (fgets(buff, sizeof buff, fp)) { in auth_Select() 238 if (buff[0] == '#') in auth_Select() 240 buff[strlen(buff) - 1] = '\0'; in auth_Select() 242 if ((n = MakeArgs(buff, vector, VECSIZE(vector), PARSE_REDUCE)) < 0) in auth_Select() [all …]
|
| /NextBSD/contrib/libarchive/libarchive/ |
| HD | archive_write_set_format_ar.c | 77 const void *buff, size_t s); 150 char buff[60]; in archive_write_ar_header() local 183 memset(buff, ' ', 60); in archive_write_ar_header() 184 strncpy(&buff[AR_fmag_offset], "`\n", 2); in archive_write_ar_header() 188 buff[AR_name_offset] = '/'; in archive_write_ar_header() 193 strncpy(buff + AR_name_offset, "__.SYMDEF", 9); in archive_write_ar_header() 202 buff[AR_name_offset] = buff[AR_name_offset + 1] = '/'; in archive_write_ar_header() 229 strncpy(&buff[AR_name_offset], in archive_write_ar_header() 231 buff[AR_name_offset + strlen(filename)] = '/'; in archive_write_ar_header() 269 buff[AR_name_offset] = '/'; in archive_write_ar_header() [all …]
|
| /NextBSD/contrib/libarchive/libarchive_fe/ |
| HD | line_reader.c | 52 char *buff, *buff_end, *line_start, *line_end, *p; member 78 lr->line_start = lr->line_end = lr->buff_end = lr->buff = NULL; in lafe_line_reader() 119 if (lr->line_start > lr->buff) { in lafe_line_reader_next() 121 memmove(lr->buff, lr->line_start, in lafe_line_reader_next() 123 lr->buff_end -= lr->line_start - lr->buff; in lafe_line_reader_next() 124 lr->line_end -= lr->line_start - lr->buff; in lafe_line_reader_next() 125 lr->line_start = lr->buff; in lafe_line_reader_next() 137 p = realloc(lr->buff, new_buff_size + 1); in lafe_line_reader_next() 141 lr->buff_end = p + (lr->buff_end - lr->buff); in lafe_line_reader_next() 142 lr->line_end = p + (lr->line_end - lr->buff); in lafe_line_reader_next() [all …]
|
| /NextBSD/lib/libedit/ |
| HD | chartype.c | 214 static Char *buff = NULL; in ct_visual_string() local 222 if (!buff) { in ct_visual_string() 224 buff = el_malloc(buffsize * sizeof(*buff)); in ct_visual_string() 226 dst = buff; in ct_visual_string() 228 used = ct_visual_char(dst, buffsize - (size_t)(dst - buff), *s); in ct_visual_string() 230 used = dst - buff; in ct_visual_string() 232 p = el_realloc(buff, buffsize * sizeof(*buff)); in ct_visual_string() 235 buff = p; in ct_visual_string() 236 dst = buff + used; in ct_visual_string() 243 if (dst >= (buff + buffsize)) { /* sigh */ in ct_visual_string() [all …]
|
| /NextBSD/contrib/libarchive/tar/ |
| HD | util.c | 201 bsdtar_expand_char(char *buff, size_t offset, char c) in bsdtar_expand_char() argument 206 buff[i++] = c; in bsdtar_expand_char() 208 buff[i++] = '\\'; in bsdtar_expand_char() 210 case '\a': buff[i++] = 'a'; break; in bsdtar_expand_char() 211 case '\b': buff[i++] = 'b'; break; in bsdtar_expand_char() 212 case '\f': buff[i++] = 'f'; break; in bsdtar_expand_char() 213 case '\n': buff[i++] = 'n'; break; in bsdtar_expand_char() 216 case '\r': buff[i++] = 'r'; break; in bsdtar_expand_char() 218 case '\t': buff[i++] = 't'; break; in bsdtar_expand_char() 219 case '\v': buff[i++] = 'v'; break; in bsdtar_expand_char() [all …]
|
| /NextBSD/usr.bin/find/ |
| HD | getdate.y | 668 LookupWord(char *buff) in LookupWord() argument 677 for (p = buff; *p; p++) in LookupWord() 681 if (strcmp(buff, "am") == 0 || strcmp(buff, "a.m.") == 0) { in LookupWord() 685 if (strcmp(buff, "pm") == 0 || strcmp(buff, "p.m.") == 0) { in LookupWord() 691 if (strlen(buff) == 3) in LookupWord() 693 else if (strlen(buff) == 4 && buff[3] == '.') { in LookupWord() 695 buff[3] = '\0'; in LookupWord() 702 if (strncmp(buff, tp->name, 3) == 0) { in LookupWord() 707 else if (strcmp(buff, tp->name) == 0) { in LookupWord() 714 if (strcmp(buff, tp->name) == 0) { in LookupWord() [all …]
|