Cleanup and added funny joke haha
[citadel.git] / ctdlsh / src / ctdlsh.h
index 48524bebe26ee85fed0738f8c9f4b1700e7821f2..77ca9e7e9db5699c488d7d9a3f6e33442a544fad 100644 (file)
@@ -1,28 +1,45 @@
 /*
- * This is a small subset of 'struct config' ... don't worry about the rest; we
- * only need to snarf the c_ipgm_secret.
+ * main header file for ctdlsh
+ *
+ * Copyright (c) 2009-2012 by the citadel.org team
+ * This program is open source software, cheerfully made available to
+ * you under the terms of the GNU General Public License version 3.
  */
-struct partial_config {
-       char c_nodename[16];            /* Unqualified "short" nodename     */
-       char c_fqdn[64];                /* Fully Qualified Domain Name      */
-       char c_humannode[21];           /* Long name of system              */
-       char c_phonenum[16];            /* Dialup number of system          */
-       uid_t c_ctdluid;                /* UID under which we run Citadel   */
-       char c_creataide;               /* room creator = room aide  flag   */
-       int c_sleeping;                 /* watchdog timer setting           */
-       char c_initax;                  /* initial access level             */
-       char c_regiscall;               /* call number to register on       */
-       char c_twitdetect;              /* twit detect flag                 */
-       char c_twitroom[128];           /* twit detect msg move to room     */
-       char c_moreprompt[80];          /* paginator prompt                 */
-       char c_restrict;                /* restrict Internet mail flag      */
-       long c_niu_1;                   /* (not in use)                     */
-       char c_site_location[32];       /* physical location of server      */
-       char c_sysadm[26];              /* name of system administrator     */
-       char c_niu_2[15];               /* (not in use)                     */
-       int c_setup_level;              /* what rev level we've setup to    */
-       int c_maxsessions;              /* maximum concurrent sessions      */
-       char c_ip_addr[20];             /* IP address to listen on          */
-       int c_port_number;              /* Cit listener port (usually 504)  */
-       int c_ipgm_secret;              /* Internal program authentication  */
+
+#include <config.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <string.h>
+#include <pwd.h>
+#include <time.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <readline/readline.h>
+
+/*
+ * Set to the location of Citadel
+ * FIXME this needs to be configurable
+ */
+#define CTDLDIR        "/appl/citadel"
+
+typedef int ctdlsh_cmdfunc_t(int, char *);
+
+enum ctdlsh_cmdfunc_return_values {
+       cmdret_ok,
+       cmdret_exit,
+       cmdret_error
 };
+
+int cmd_help(int, char *);
+int cmd_quit(int, char *);
+int cmd_datetime(int, char *);
+int cmd_passwd(int, char *);
+int cmd_shutdown(int, char *);