• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/usr.bin/sort/

Lines Matching refs:fl

215 file_list_init(struct file_list *fl, bool tmp)
218 if (fl) {
219 fl->count = 0;
220 fl->sz = 0;
221 fl->fns = NULL;
222 fl->tmp = tmp;
230 file_list_add(struct file_list *fl, const char *fn, bool allocate)
233 if (fl && fn) {
234 if (fl->count >= fl->sz || (fl->fns == NULL)) {
235 fl->sz = (fl->sz) * 2 + 1;
236 fl->fns = sort_realloc(fl->fns, fl->sz *
239 fl->fns[fl->count] = allocate ? sort_strdup(fn) : fn;
240 fl->count += 1;
248 file_list_populate(struct file_list *fl, int argc, char **argv, bool allocate)
251 if (fl && argv) {
255 file_list_add(fl, argv[i], allocate);
264 file_list_clean(struct file_list *fl)
267 if (fl) {
268 if (fl->fns) {
271 for (i = 0; i < fl->count; i++) {
272 if (fl->fns[i]) {
273 if (fl->tmp)
274 unlink(fl->fns[i]);
275 sort_free(fl->fns[i]);
276 fl->fns[i] = 0;
279 sort_free(fl->fns);
280 fl->fns = NULL;
282 fl->sz = 0;
283 fl->count = 0;
284 fl->tmp = false;
834 procfile(const char *fsrc, struct sort_list *list, struct file_list *fl)
858 file_list_add(fl, fn, false);
1151 shrink_file_list(struct file_list *fl)
1154 if ((fl == NULL) || (size_t) (fl->count) < max_open_files)
1161 while (indx < fl->count) {
1165 num = fl->count - indx;
1170 merge_files_array(num, fl->fns + indx, fnew);
1171 if (fl->tmp) {
1175 unlink(fl->fns[indx + i]);
1180 fl->tmp = false; /* already taken care of */
1181 file_list_clean(fl);
1183 fl->count = new_fl.count;
1184 fl->fns = new_fl.fns;
1185 fl->sz = new_fl.sz;
1186 fl->tmp = new_fl.tmp;
1196 merge_files(struct file_list *fl, const char *fn_out)
1199 if (fl && fn_out) {
1200 while (shrink_file_list(fl));
1202 merge_files_array(fl->count, fl->fns, fn_out);