server/servutil.c: Reorder and categorize the functions.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 22 Aug 2017 23:10:49 +0000 (00:10 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 14 Jun 2018 09:34:25 +0000 (10:34 +0100)
Might be more coming.  Not saying yet. :-)

server/servutil.c

index ed73e6d..e4772c4 100644 (file)
 
 octet buf_i[PKBUFSZ], buf_o[PKBUFSZ], buf_t[PKBUFSZ], buf_u[PKBUFSZ];
 
-/*----- Main code ---------------------------------------------------------*/
-
-/* --- @timestr@ --- *
- *
- * Arguments:  @time_t t@ = a time to convert
- *
- * Returns:    A pointer to a textual representation of the time.
- *
- * Use:                Converts a time to a textual representation.  Corrupts
- *             @buf_u@.
- */
-
-const char *timestr(time_t t)
-{
-  struct tm *tm;
-  if (!t)
-    return ("NEVER");
-  tm = localtime(&t);
-  strftime((char *)buf_u, sizeof(buf_u), "%Y-%m-%dT%H:%M:%S", tm);
-  return ((const char *)buf_u);
-}
-
-/* --- @mystrieq@ --- *
- *
- * Arguments:  @const char *x, *y@ = two strings
- *
- * Returns:    True if @x@ and @y are equal, up to case.
- */
-
-int mystrieq(const char *x, const char *y)
-{
-  for (;;) {
-    if (!*x && !*y) return (1);
-    if (tolower((unsigned char)*x) != tolower((unsigned char)*y))
-      return (0);
-    x++; y++;
-  }
-}
+/*----- Sequence numbers --------------------------------------------------*/
 
 /* --- @seq_reset@ --- *
  *
@@ -119,4 +82,43 @@ int seq_check(seqwin *s, uint32 q, const char *service)
   return (0);
 }
 
+/*----- Random odds and sods ----------------------------------------------*/
+
+/* --- @timestr@ --- *
+ *
+ * Arguments:  @time_t t@ = a time to convert
+ *
+ * Returns:    A pointer to a textual representation of the time.
+ *
+ * Use:                Converts a time to a textual representation.  Corrupts
+ *             @buf_u@.
+ */
+
+const char *timestr(time_t t)
+{
+  struct tm *tm;
+  if (!t)
+    return ("NEVER");
+  tm = localtime(&t);
+  strftime((char *)buf_u, sizeof(buf_u), "%Y-%m-%dT%H:%M:%S", tm);
+  return ((const char *)buf_u);
+}
+
+/* --- @mystrieq@ --- *
+ *
+ * Arguments:  @const char *x, *y@ = two strings
+ *
+ * Returns:    True if @x@ and @y are equal, up to case.
+ */
+
+int mystrieq(const char *x, const char *y)
+{
+  for (;;) {
+    if (!*x && !*y) return (1);
+    if (tolower((unsigned char)*x) != tolower((unsigned char)*y))
+      return (0);
+    x++; y++;
+  }
+}
+
 /*----- That's all, folks -------------------------------------------------*/