• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/text_cmds-88/sort/

Lines Matching +defs:diff +defs:file +defs:next

154   struct keyfield *next;	/* Next keyfield to try. */
267 die (char const *message, char const *file)
269 error (0, errno, "%s: %s", message, file ? file : _("standard output"));
389 struct tempnode *volatile next;
390 char name[1]; /* Actual size is 1 + file name length. */
402 for (node = temphead; node; node = node->next)
406 /* Create a new temporary file, returning its newly allocated name.
421 char *file = node->name;
423 memcpy (file, temp_dir, len);
424 memcpy (file + len, slashbase, sizeof slashbase);
425 node->next = NULL;
429 /* Create the temporary file in a critical section, to avoid races. */
431 fd = mkstemp (file);
435 temptail = &node->next;
442 die (_("cannot create temporary file"), file);
444 return file;
449 means standard input. To avoid confusion, do not return file
454 xfopen (const char *file, const char *how)
458 if (!file)
460 else if (STREQ (file, "-") && *how == 'r')
467 fp = fopen (file, how);
469 die (_("open failed"), file);
478 xfclose (FILE *fp, char const *file)
491 die (_("fflush failed"), file);
496 die (_("close failed"), file);
525 struct tempnode *next;
530 for (pnode = &temphead; (node = *pnode)->name != name; pnode = &node->next)
533 /* Unlink the temporary file in a critical section to avoid races. */
534 next = node->next;
538 *pnode = next;
543 if (! next)
744 /* The file has unknown size. If the user specified a sort
956 file wasn't terminated by a newline, supply one. Set up BUF's line
957 table too. FILE is the name of the file corresponding to FP.
961 fillbuf (struct buffer *buf, FILE *fp, char const *file)
991 rest of the input file consists entirely of newlines,
1002 die (_("read failed"), file);
1170 int diff;
1187 diff = ((key->numeric ? numcompare : general_numcompare)
1192 diff = getmonth (texta, lena) - getmonth (textb, lenb);
1226 diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b);
1232 diff = - NONZERO (lenb);
1236 diff = xmemcoll (texta, lena, textb, lenb);
1251 diff = to_uchar (A) - to_uchar (B); \
1252 if (diff) \
1258 diff = (texta < lima) - (textb < limb); \
1269 diff = - NONZERO (lenb);
1278 diff = (to_uchar (translate[to_uchar (*texta++)])
1280 if (diff)
1286 diff = memcmp (texta, textb, MIN (lena, lenb));
1287 if (diff)
1290 diff = lena < lenb ? -1 : lena != lenb;
1293 if (diff)
1296 key = key->next;
1300 /* Find the beginning and limit of the next field. */
1324 diff = 1;
1326 return key->reverse ? -diff : diff;
1335 int diff;
1343 diff = keycompare (a, b);
1344 if (diff | unique | stable)
1345 return diff;
1353 diff = - NONZERO (blen);
1355 diff = 1;
1357 diff = xmemcoll (a->text, alen, b->text, blen);
1358 else if (! (diff = memcmp (a->text, b->text, MIN (alen, blen))))
1359 diff = alen < blen ? -1 : alen != blen;
1361 return reverse ? -diff : diff;
1452 OUTPUT_FILE gives the name of the output file. If it is NULL,
1453 the output file is standard output. If OFP is NULL, the output
1454 file has not been opened yet (or written to, if standard output). */
1460 FILE *fps[NMERGE]; /* Input streams for each file. */
1461 struct buffer buffer[NMERGE]; /* Input buffers for each file. */
1470 and will be next output. */
1477 /* Read initial lines from each input file. */
1746 /* Scan through FILES[NTEMPS .. NFILES-1] looking for a file that is
1748 some other files) into a temporary file so that it can in turn be
1831 /* Number of easily-available slots at the next loop iteration. */
1864 window, so they will be merged in the next pass. */
1888 char const *file = *files;
1889 FILE *fp = xfopen (file, "r");
1901 while (fillbuf (&buf, fp, file))
1910 /* End of file, but there is more input and buffer room.
1911 Concatenate the next input file; this is faster in
1923 xfclose (fp, file);
1949 xfclose (fp, file);
1963 node = node->next;
1977 for (p = &keylist; *p; p = &(*p)->next)
1980 key->next = NULL;
2197 /* Parse an operand as a file after "--" was seen; or if
2198 pedantic and a file was seen, unless the POSIX version
2224 treat an operand as a file if it is not a valid +POS1. */
2390 Solaris 2.5.1 "sort -y 100" reads the input file "100", but
2417 for (key = keylist; key; key = key->next)