|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T s
Length: 1300 (0x514) Types: TextFile Names: »scandir.c«
└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit └─⟦cfd40dc56⟧ »EurOpenD3/news/nntp/nntp.1.5.8.tar.Z« └─⟦2ec98eca6⟧ └─⟦this⟧ »server/scandir.c« └─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit └─⟦5cced586a⟧ »EurOpenD3/news/nntp/nntp.1.5.7.tar.Z« └─⟦7340f105e⟧ └─⟦this⟧ »./server/scandir.c«
#ifndef lint static char *sccsid = "@(#)scandir.c 1.3 (Berkeley) 6/26/87"; #endif #include "common.h" /* * scan_dir -- scan the current directory for news articles, * loading the article numbers into art_array. Return * number of articles loaded. * * Paramaters: "low_msg", "high_msg" are the low * and high messages numbers in this * group; we ignore numbers outside this * range. * * Returns: Number of articles loaded into * array. * * Side effects: Changes "art_array". */ extern int intcmp(); scan_dir(low_msg, high_msg) int low_msg, high_msg; { register struct direct *dirent; register DIR *dirp; int artnum; num_arts = 0; dirp = opendir("."); if (dirp == NULL) return (0); while ((dirent = readdir(dirp)) != NULL) { artnum = atoi(dirent->d_name); if (artnum != 0 && artnum >= low_msg && artnum <= high_msg) art_array[num_arts++] = artnum; } closedir(dirp); qsort((char *) art_array, num_arts, sizeof(int), intcmp); return (num_arts); } /* * intcmp -- compare to integers. * * Parameters: "x", "y" point to the integers to be compared. * * Returns: -1 if "x" is less than "y", * 0 if "x" equals "y", and * 1 if "x" is greater than "y". * * Side effects: None. */ intcmp(x, y) register int *x, *y; { return (*x - *y); }