+2006-02-20 Josh Bressers <josh@bress.net>
+
+ * h/utils.h, sbr/utils.c, uip/flist.c, uip/folder.c: Move duplicate
+ function num_digits into utils.c
+
2006-02-19 Josh Bressers <josh@bress.net>
* sbr/m_draft.c, sbr/utils.c, uip/folder.c, uip/inc.c,
char *pwd(void);
char *add(char *, char *);
void create_folder(char *, int, void (*)());
+int num_digits(int);
adios (NULL, "unable to create folder %s", folder);
}
}
+
+/*
+ * num_digits
+ * Return the number of digits in a nonnegative integer.
+ */
+int
+num_digits (int n)
+{
+ int ndigits = 0;
+
+ /* Sanity check */
+ if (n < 0)
+ adios (NULL, "oops, num_digits called with negative value");
+
+ if (n == 0)
+ return 1;
+
+ while (n) {
+ n /= 10;
+ ndigits++;
+ }
+
+ return ndigits;
+}
void BuildFolderList(char *, int);
void BuildFolderListRecurse(char *, struct stat *, int);
void PrintFolders(void);
-static int num_digits (int);
void AllocFolders(struct Folder **, int *, int);
int AssignPriority(char *);
static void do_readonly_folders(void);
}
/*
- * Calculate the number of digits in a nonnegative integer
- */
-static int
-num_digits (int n)
-{
- int ndigits = 0;
-
- /* Sanity check */
- if (n < 0)
- adios (NULL, "oops, num_digits called with negative value");
-
- if (n == 0)
- return 1;
-
- while (n) {
- n /= 10;
- ndigits++;
- }
-
- return ndigits;
-}
-
-/*
* Put them in priority order.
*/
static void dodir (char *);
static int get_folder_info (char *, char *);
static void print_folders (void);
-static int num_digits (int);
static int sfold (struct msgs *, char *);
static void addir (char *);
static void addfold (char *);
}
/*
- * Calculate the number of digits in a nonnegative integer
- */
-int
-num_digits (int n)
-{
- int ndigits = 0;
-
- /* Sanity check */
- if (n < 0)
- adios (NULL, "oops, num_digits called with negative value");
-
- if (n == 0)
- return 1;
-
- while (n) {
- n /= 10;
- ndigits++;
- }
-
- return ndigits;
-}
-
-/*
* Set the current message and sychronize sequences
*/