Lines Matching refs:handle
57 static char FAST_FUNC filter_replaceable(archive_handle_t *handle) in filter_replaceable() argument
59 if (find_list_entry(handle->accept, handle->file_header->name)) in filter_replaceable()
65 static void output_ar_header(archive_handle_t *handle) in output_ar_header() argument
81 struct file_header_t *fh = handle->file_header; in output_ar_header()
83 if (handle->offset & 1) { in output_ar_header()
84 xwrite(handle->src_fd, "\n", 1); in output_ar_header()
85 handle->offset++; in output_ar_header()
92 fdprintf(handle->src_fd, "%-16.16s%-12lu%-6u%-6u%-8o%-10"OFF_FMT"u`\n", in output_ar_header()
101 handle->offset += AR_HEADER_LEN; in output_ar_header()
108 static void FAST_FUNC copy_data(archive_handle_t *handle) in copy_data() argument
110 archive_handle_t *out_handle = handle->ar__out; in copy_data()
111 struct file_header_t *fh = handle->file_header; in copy_data()
116 bb_copyfd_exact_size(handle->src_fd, out_handle->src_fd, fh->size); in copy_data()
120 static int write_ar_header(archive_handle_t *handle) in write_ar_header() argument
127 fn = llist_pop(&handle->accept); in write_ar_header()
133 handle->file_header->mtime = st.st_mtime; in write_ar_header()
134 handle->file_header->uid = st.st_uid; in write_ar_header()
135 handle->file_header->gid = st.st_gid; in write_ar_header()
136 handle->file_header->mode = st.st_mode; in write_ar_header()
137 handle->file_header->size = st.st_size; in write_ar_header()
138 handle->file_header->name = fn_h; in write_ar_header()
142 output_ar_header(handle); in write_ar_header()
145 bb_copyfd_exact_size(fd, handle->src_fd, st.st_size); in write_ar_header()
147 handle->offset += st.st_size; in write_ar_header()
152 static int write_ar_archive(archive_handle_t *handle) in write_ar_archive() argument
157 xfstat(handle->src_fd, &st, handle->ar__name); in write_ar_archive()
164 xunlink(handle->ar__name); in write_ar_archive()
165 out_handle->src_fd = xopen(handle->ar__name, O_WRONLY | O_CREAT | O_TRUNC); in write_ar_archive()
166 out_handle->accept = handle->accept; in write_ar_archive()
168 out_handle = handle; in write_ar_archive()
171 handle->ar__out = out_handle; in write_ar_archive()
178 handle->filter = filter_replaceable; in write_ar_archive()
179 handle->action_data = copy_data; in write_ar_archive()
180 unpack_ar_archive(handle); in write_ar_archive()
188 close(handle->src_fd); in write_ar_archive()
189 if (out_handle->src_fd != handle->src_fd) in write_ar_archive()