]> diplodocus.org Git - nmh/blobdiff - uip/flist.c
Match `NORETURN' function prototypes by adding it to definition.
[nmh] / uip / flist.c
index 84f6ba29427ecbd3619e6dde96343683a9aa3311..02d6f5e7d6d1ebf19af39bff94ea82417bf711b5 100644 (file)
@@ -1,5 +1,4 @@
-/*
- * flist.c -- list nmh folders containing messages
+/* flist.c -- list nmh folders containing messages
  *         -- in a given sequence
  *
  * originally by
  *         -- in a given sequence
  *
  * originally by
@@ -90,17 +89,17 @@ static char *nmhdir;                /* base nmh mail directory    */
 typedef int (*qsort_comp) (const void *, const void *);
 
 /*
 typedef int (*qsort_comp) (const void *, const void *);
 
 /*
- * prototypes
+ * static prototypes
  */
  */
-int CompareFolders(struct Folder *, struct Folder *);
-void GetFolderOrder(void);
-void ScanFolders(void);
-int AddFolder(char *, int);
-void BuildFolderList(char *, int);
-void BuildFolderListRecurse(char *, struct stat *, int);
-void PrintFolders(void);
-void AllocFolders(struct Folder **, int *, int);
-int AssignPriority(char *);
+static int CompareFolders(struct Folder *, struct Folder *);
+static void GetFolderOrder(void);
+static void ScanFolders(void);
+static int AddFolder(char *, int);
+static void BuildFolderList(char *, int);
+static void BuildFolderListRecurse(char *, struct stat *, int);
+static void PrintFolders(void);
+static void AllocFolders(struct Folder **, int *, int);
+static int AssignPriority(char *);
 static void do_readonly_folders(void);
 
 
 static void do_readonly_folders(void);
 
 
@@ -118,7 +117,7 @@ main(int argc, char **argv)
      * If program was invoked with name ending
      * in `s', then add switch `-all'.
      */
      * If program was invoked with name ending
      * in `s', then add switch `-all'.
      */
-    all = EndsWithC(argv[0], 's');
+    all = has_suffix_c(argv[0], 's');
 
     arguments = getarguments (invo_name, argc, argv, 1);
     argp = arguments;
 
     arguments = getarguments (invo_name, argc, argv, 1);
     argp = arguments;
@@ -254,7 +253,7 @@ main(int argc, char **argv)
  * how to sort folders for output.
  */
 
  * how to sort folders for output.
  */
 
-void
+static void
 GetFolderOrder(void)
 {
     char *p, *s;
 GetFolderOrder(void)
 {
     char *p, *s;
@@ -286,7 +285,7 @@ GetFolderOrder(void)
  * Scan all the necessary folders
  */
 
  * Scan all the necessary folders
  */
 
-void
+static void
 ScanFolders(void)
 {
     int i;
 ScanFolders(void)
 {
     int i;
@@ -335,7 +334,7 @@ ScanFolders(void)
  * the top of our search tree.
  */
 
  * the top of our search tree.
  */
 
-void
+static void
 BuildFolderList(char *dirName, int searchdepth)
 {
     struct stat st;
 BuildFolderList(char *dirName, int searchdepth)
 {
     struct stat st;
@@ -366,7 +365,7 @@ BuildFolderList(char *dirName, int searchdepth)
  * Recursive building of folder list
  */
 
  * Recursive building of folder list
  */
 
-void
+static void
 BuildFolderListRecurse(char *dirName, struct stat *s, int searchdepth)
 {
     char *base, name[PATH_MAX];
 BuildFolderListRecurse(char *dirName, struct stat *s, int searchdepth)
 {
     char *base, name[PATH_MAX];
@@ -438,7 +437,7 @@ BuildFolderListRecurse(char *dirName, struct stat *s, int searchdepth)
  * messages and the number of messages in each sequence.
  */
 
  * messages and the number of messages in each sequence.
  */
 
-int
+static int
 AddFolder(char *name, int force)
 {
     unsigned int i;
 AddFolder(char *name, int force)
 {
     unsigned int i;
@@ -516,7 +515,7 @@ AddFolder(char *name, int force)
  * Print the folder/sequence information
  */
 
  * Print the folder/sequence information
  */
 
-void
+static void
 PrintFolders(void)
 {
     char tmpname[BUFSIZ];
 PrintFolders(void)
 {
     char tmpname[BUFSIZ];
@@ -526,7 +525,7 @@ PrintFolders(void)
 
     if (!Total) {
        for (i = 0; i < nFolders; i++)
 
     if (!Total) {
        for (i = 0; i < nFolders; i++)
-           printf("%s\n", folders[i].name);
+           puts(folders[i].name);
        return;
     }
 
        return;
     }
 
@@ -595,20 +594,19 @@ PrintFolders(void)
  * Put them in priority order.
  */
 
  * Put them in priority order.
  */
 
-int
+static int
 CompareFolders(struct Folder *f1, struct Folder *f2)
 {
     if (!alphaOrder && f1->priority != f2->priority)
        return f1->priority - f2->priority;
 CompareFolders(struct Folder *f1, struct Folder *f2)
 {
     if (!alphaOrder && f1->priority != f2->priority)
        return f1->priority - f2->priority;
-    else
-       return strcmp(f1->name, f2->name);
+    return strcmp(f1->name, f2->name);
 }
 
 /*
  * Make sure we have at least n folders allocated.
  */
 
 }
 
 /*
  * Make sure we have at least n folders allocated.
  */
 
-void
+static void
 AllocFolders(struct Folder **f, int *nfa, int n)
 {
     if (n <= *nfa)
 AllocFolders(struct Folder **f, int *nfa, int n)
 {
     if (n <= *nfa)
@@ -626,7 +624,7 @@ AllocFolders(struct Folder **f, int *nfa, int n)
  * Return the priority for a name.  The highest comes from an exact match.
  * After that, the longest match (then first) assigns the priority.
  */
  * Return the priority for a name.  The highest comes from an exact match.
  * After that, the longest match (then first) assigns the priority.
  */
-int
+static int
 AssignPriority(char *name)
 {
     int i, ol, nl;
 AssignPriority(char *name)
 {
     int i, ol, nl;