The little LEDs on the NanoPi blink when there is activity.
authorArt Cancro <ajc@citadel.org>
Fri, 5 Jan 2024 20:22:18 +0000 (15:22 -0500)
committerArt Cancro <ajc@citadel.org>
Fri, 5 Jan 2024 20:22:18 +0000 (15:22 -0500)
It's fun to watch.  It's fun to build on ARM first and try x86 later.

citadel/server/citserver.h
citadel/server/ctdl_module.h
citadel/server/internet_addressing.h
citadel/utils/setup.c

index 569aeeba17b7ba3892f133f1b3d5b3f8b7e3995f..9eaaa16af037d979e92b88e852293ef3a32fa5ff 100644 (file)
@@ -7,7 +7,7 @@
 #include "context.h"
 #include "ctdl_module.h"
 
-/* Simple linked list structures ... used in a bunch of different places. */
+// Simple linked list structures ... used in a bunch of different places.
 typedef struct RoomProcList RoomProcList;
 struct RoomProcList {
         struct RoomProcList *next;
index e3ec8098bf3f0e4ca2c01db221fdc198b33ca99c..b588fe8bb9ea5908c829a7d724560b672cb0b39e 100644 (file)
@@ -46,9 +46,7 @@
 extern int threading;
 
 
-/*
- * define macros for module init stuff
- */
+// define macros for module init stuff
  
 #define CTDL_MODULE_INIT(module_name) char *ctdl_module_##module_name##_init (int threading)
 
@@ -68,36 +66,24 @@ extern int threading;
                FMT_CITADEL,                    \
                SUBJECT) 
 
-/*
- * Hook functions available to modules.
- */
-/* Priorities for  */
+// Hook functions available to modules.
+
+// Priority levels for event hooks
 #define PRIO_QUEUE 500
 #define PRIO_AGGR 1000
 #define PRIO_SEND 1500
 #define PRIO_CLEANUP 2000
-/* Priorities for EVT_HOUSE */
 #define PRIO_HOUSE 3000
-/* Priorities for EVT_LOGIN */
 #define PRIO_CREATE 10000
-/* Priorities for EVT_LOGOUT */
 #define PRIO_LOGOUT 15000
-/* Priorities for EVT_LOGIN */
 #define PRIO_LOGIN 20000
-/* Priorities for EVT_START */
 #define PRIO_START 25000
-/* Priorities for EVT_STOP */
 #define PRIO_STOP 30000
-/* Priorities for EVT_ASYNC */
 #define PRIO_ASYNC 35000
-/* Priorities for EVT_SHUTDOWN */
 #define PRIO_SHUTDOWN 40000
-/* Priorities for EVT_UNSTEALTH */
 #define PRIO_UNSTEALTH 45000
-/* Priorities for EVT_STEALTH */
 #define PRIO_STEALTH 50000
 
-
 void CtdlRegisterSessionHook(void (*fcn_ptr)(void), int EventType, int Priority);
 void CtdlShutdownServiceHooks(void);
 void CtdlRegisterUserHook(void (*fcn_ptr)(struct ctdluser *), int EventType);
@@ -109,34 +95,28 @@ void CtdlRegisterCleanupHook(void (*fcn_ptr)(void));
 void CtdlRegisterEVCleanupHook(void (*fcn_ptr)(void));
 void CtdlRegisterProtoHook(void (*handler)(char *), char *cmd, char *desc);
 void CtdlRegisterServiceHook(int tcp_port,
-                            char *sockpath,
-                            void (*h_greeting_function) (void),
-                            void (*h_command_function) (void),
-                            void (*h_async_function) (void),
-                            const char *ServiceName
+                       char *sockpath,
+                       void (*h_greeting_function) (void),
+                       void (*h_command_function) (void),
+                       void (*h_async_function) (void),
+                       const char *ServiceName
 );
 void CtdlRegisterFixedOutputHook(char *content_type, void (*output_function) (char *supplied_data, int len));
 void CtdlRegisterMaintenanceThread(char *name, void *(*thread_proc) (void *arg));
 
-/*
- * if you say a) (which may take a while)
- * don't forget to say b)
- */
-void CtdlDisableHouseKeeping(void);
-void CtdlEnableHouseKeeping(void);
+void CtdlDisableHouseKeeping(void);            // If you call this, it may take a while...
+void CtdlEnableHouseKeeping(void);             // ...so don't forget to call this later.
 
-/* TODODRW: This needs to be changed into a hook type interface
- * for now we have this horrible hack
- */
+// TODODRW: This needs to be changed into a hook type interface
+// for now we have this horrible hack
 void CtdlModuleStartCryptoMsgs(char *ok_response, char *nosup_response, char *error_response);
 
-/* return the current context list as an array and do it in a safe manner
- * The returned data is a copy so only reading is useful
- * The number of contexts is returned in count.
- * Beware, this does not copy any of the data pointed to by the context.
- * This means that you can not rely on things like the redirect buffer being valid.
- * You must free the returned pointer when done.
- */
+// return the current context list as an array and do it in a safe manner
+// The returned data is a copy so only reading is useful
+// The number of contexts is returned in count.
+// Beware, this does not copy any of the data pointed to by the context.
+// This means that you can not rely on things like the redirect buffer being valid.
+// You must free the returned pointer when done.
 struct CitContext *CtdlGetContextArray (int *count);
 void CtdlFillSystemContext(struct CitContext *context, char *name);
 int CtdlTrySingleUser(void);
@@ -150,20 +130,16 @@ int CtdlIsUserLoggedInByNum (long usernum);
 void CtdlBumpNewMailCounter(long which_user);
 
 
-/*
- * CtdlGetCurrentMessageNumber()  -  Obtain the current highest message number in the system
- * This provides a quick way to initialize a variable that might be used to indicate
- * messages that should not be processed.  For example, a new inbox script will use this
- * to record determine that messages older than this should not be processed.
- * This function is defined in control.c
- */
+// CtdlGetCurrentMessageNumber()  -  Obtain the current highest message number in the system
+// This provides a quick way to initialize a variable that might be used to indicate
+// messages that should not be processed.  For example, a new inbox script will use this
+// to record determine that messages older than this should not be processed.
+// This function is defined in control.c
 long CtdlGetCurrentMessageNumber(void);
 
 
 
-/*
- * Expose various room operation functions from room_ops.c to the modules API
- */
+// Expose various room operation functions from room_ops.c to the modules API
 
 unsigned CtdlCreateRoom(char *new_room_name,
                        int new_room_type,
@@ -195,26 +171,22 @@ int CtdlGetAvailableFloor(void);
 int CtdlIsNonEditable(struct ctdlroom *qrbuf);
 void CtdlPutRoom(struct ctdlroom *);
 
-/*
- * Possible return values for CtdlRenameRoom()
- */
+// Possible return values for CtdlRenameRoom()
 enum {
-       crr_ok,                         /* success */
-       crr_room_not_found,             /* room not found */
-       crr_already_exists,             /* new name already exists */
-       crr_noneditable,                /* cannot edit this room */
-       crr_invalid_floor,              /* target floor does not exist */
-       crr_access_denied               /* not allowed to edit this room */
+       crr_ok,                         // success
+       crr_room_not_found,             // room not found
+       crr_already_exists,             // new name already exists
+       crr_noneditable,                // cannot edit this room
+       crr_invalid_floor,              // target floor does not exist
+       crr_access_denied               // not allowed to edit this room
 };
 
 
 
-/*
- * API declarations from citserver.h
- */
+// API declarations from citserver.h
 int CtdlAccessCheck(int);
-/* 'required access level' values which may be passed to CtdlAccessCheck()
- */
+
+// 'required access level' values which may be passed to CtdlAccessCheck()
 enum {
        ac_none,
        ac_logged_in_or_guest,
@@ -235,10 +207,7 @@ enum {
 #define CtdlREGISTERRoomCfgType(a, p, uniq, nSegs, s, d) RegisterRoomCfgType(#a, sizeof(#a) - 1, a, p, uniq, nSegs, s, d);
 
 
-
-/*
- * Expose API calls from user_ops.c
- */
+// Expose API calls from user_ops.c
 int CtdlGetUser(struct ctdluser *usbuf, char *name);
 int CtdlGetUserLen(struct ctdluser *usbuf, const char *name, long len);
 int CtdlGetUserLock(struct ctdluser *usbuf, char *name);
@@ -252,9 +221,7 @@ void CtdlSetRelationship(struct visit *newvisit, struct ctdluser *rel_user, stru
 void CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix);
 int CtdlLoginExistingUser(const char *username);
 
-/*
- * Values which may be returned by CtdlLoginExistingUser()
- */
+// Values which may be returned by CtdlLoginExistingUser()
 enum {
        pass_ok,
        pass_already_logged_in,
@@ -264,9 +231,8 @@ enum {
 };
 
 int CtdlTryPassword(const char *password, long len);
-/*
- * Values which may be returned by CtdlTryPassword()
- */
+
+// Values which may be returned by CtdlTryPassword()
 enum {
        login_ok,
        login_already_logged_in,
@@ -276,20 +242,12 @@ enum {
 
 void CtdlUserLogout(void);
 
-/*
- * Expose API calls from msgbase.c
- */
-
 
-/*
- * Expose API calls from euidindex.c
- */
+// Expose API calls from euidindex.c
 long CtdlLocateMessageByEuid(char *euid, struct ctdlroom *qrbuf);
 
 
-/*
- * Expose API calls from external authentication driver
- */
+// Expose API calls from external authentication driver
 int attach_extauth(struct ctdluser *who, StrBuf *claimed_id);
 
-#endif /* CTDL_MODULE_H */
+#endif
index 443033561ee235be2bb8ffefcfebbdd0a5fc9101..0f3793858a9ad79baad5de259332cd1b527b9a46 100644 (file)
@@ -23,9 +23,7 @@ int CtdlHostAlias(char *fqdn);
 char *harvest_collected_addresses(struct CtdlMessage *msg);
 int is_email_subscribed_to_list(char *email, char *room_name);
 
-/* 
- * Values that can be returned by CtdlHostAlias()
- */
+// Values that can be returned by CtdlHostAlias()
 enum {
        hostalias_nomatch,
        hostalias_localhost,
index a021913a3c16a3d74146f16b3052208276c8cafb..a2839ca72d7a237dfa79d4d8f972d14d7a9ff941 100644 (file)
@@ -1,6 +1,6 @@
 // Citadel setup utility
 //
-// Copyright (c) 1987-2023 by the citadel.org team
+// Copyright (c) 1987-2024 by the citadel.org team
 //
 // This program is open source software.  Use, duplication, or disclosure
 // is subject to the terms of the GNU General Public License, version 3.
@@ -62,8 +62,8 @@ typedef enum _SetupStep {
        eMaxQuestions = 12
 } eSetupStep;
 
-///"CREATE_XINETD_ENTRY";
-/* Environment variables, don't translate! */
+// "CREATE_XINETD_ENTRY";
+// Environment variables, don't translate!
 const char *EnvNames [eMaxQuestions] = {
         "HOME_DIRECTORY",
        "SYSADMIN_NAME",