Lines Matching refs:ar

56  * Define structure of the "ar" header.
96 a->archive.archive_format_name = "ar (BSD)";
112 a->archive.archive_format_name = "ar (GNU/SVR4)";
123 struct ar_w *ar;
129 ar = (struct ar_w *)malloc(sizeof(*ar));
130 if (ar == NULL) {
131 archive_set_error(&a->archive, ENOMEM, "Can't allocate ar data");
134 memset(ar, 0, sizeof(*ar));
135 a->format_data = ar;
137 a->format_name = "ar";
152 struct ar_w *ar;
158 ar = (struct ar_w *)a->format_data;
159 ar->is_strtab = 0;
176 * we need first write the ar global header.
178 if (!ar->wrote_global_header) {
180 ar->wrote_global_header = 1;
201 ar->is_strtab = 1;
239 if (ar->has_strtab <= 0) {
255 ss = strstr(ar->strtab, se);
270 if (format_decimal(ss - ar->strtab,
348 ar->entry_bytes_remaining = size;
349 ar->entry_padding = ar->entry_bytes_remaining % 2;
355 ar->entry_bytes_remaining -= strlen(filename);
364 struct ar_w *ar;
367 ar = (struct ar_w *)a->format_data;
368 if (s > ar->entry_bytes_remaining)
369 s = (size_t)ar->entry_bytes_remaining;
371 if (ar->is_strtab > 0) {
372 if (ar->has_strtab > 0) {
378 ar->strtab = (char *)malloc(s);
379 if (ar->strtab == NULL) {
384 strncpy(ar->strtab, buff, s);
385 ar->has_strtab = 1;
392 ar->entry_bytes_remaining -= s;
399 struct ar_w *ar;
401 ar = (struct ar_w *)a->format_data;
403 if (ar == NULL)
406 if (ar->has_strtab > 0) {
407 free(ar->strtab);
408 ar->strtab = NULL;
411 free(ar);
419 struct ar_w *ar;
424 * the ar global header now to make it a valid ar archive.
426 ar = (struct ar_w *)a->format_data;
427 if (!ar->wrote_global_header) {
428 ar->wrote_global_header = 1;
439 struct ar_w *ar;
442 ar = (struct ar_w *)a->format_data;
444 if (ar->entry_bytes_remaining != 0) {
450 if (ar->entry_padding == 0) {
454 if (ar->entry_padding != 1) {
457 (uintmax_t)ar->entry_padding);
518 /* Negative values in ar header are meaningless, so use 0. */