Lines Matching refs:ar

57  * Define structure of the "ar" header.
97 a->archive.archive_format_name = "ar (BSD)";
113 a->archive.archive_format_name = "ar (GNU/SVR4)";
124 struct ar_w *ar;
130 ar = (struct ar_w *)calloc(1, sizeof(*ar));
131 if (ar == NULL) {
132 archive_set_error(&a->archive, ENOMEM, "Can't allocate ar data");
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;
206 ar->is_strtab = 1;
244 if (ar->has_strtab <= 0) {
260 ss = strstr(ar->strtab, se);
275 if (format_decimal(ss - ar->strtab,
353 ar->entry_bytes_remaining = size;
354 ar->entry_padding = ar->entry_bytes_remaining % 2;
360 ar->entry_bytes_remaining -= strlen(filename);
369 struct ar_w *ar;
372 ar = (struct ar_w *)a->format_data;
373 if (s > ar->entry_bytes_remaining)
374 s = (size_t)ar->entry_bytes_remaining;
376 if (ar->is_strtab > 0) {
377 if (ar->has_strtab > 0) {
383 ar->strtab = (char *)malloc(s + 1);
384 if (ar->strtab == NULL) {
389 memcpy(ar->strtab, buff, s);
390 ar->strtab[s] = '\0';
391 ar->has_strtab = 1;
398 ar->entry_bytes_remaining -= s;
405 struct ar_w *ar;
407 ar = (struct ar_w *)a->format_data;
409 if (ar == NULL)
412 if (ar->has_strtab > 0) {
413 free(ar->strtab);
414 ar->strtab = NULL;
417 free(ar);
425 struct ar_w *ar;
430 * the ar global header now to make it a valid ar archive.
432 ar = (struct ar_w *)a->format_data;
433 if (!ar->wrote_global_header) {
434 ar->wrote_global_header = 1;
445 struct ar_w *ar;
448 ar = (struct ar_w *)a->format_data;
450 if (ar->entry_bytes_remaining != 0) {
456 if (ar->entry_padding == 0) {
460 if (ar->entry_padding != 1) {
463 (uintmax_t)ar->entry_padding);
524 /* Negative values in ar header are meaningless, so use 0. */