]> andersk Git - moira.git/commitdiff
Initial revision
authormar <mar>
Tue, 27 Dec 1988 18:48:57 +0000 (18:48 +0000)
committermar <mar>
Tue, 27 Dec 1988 18:48:57 +0000 (18:48 +0000)
clients/moira/menu.h [new file with mode: 0644]
include/Makefile [new file with mode: 0644]

diff --git a/clients/moira/menu.h b/clients/moira/menu.h
new file mode 100644 (file)
index 0000000..db0a6a9
--- /dev/null
@@ -0,0 +1,42 @@
+#define MAX_ARGC 16            /* Maximum argument count per line */
+#define MAX_ARGLEN 128         /* Maximum length of an argument */
+#define MAX_LINES 16           /* Maximum number of lines per menu */
+
+#define MAX_TITLE 1            /* Maximum length of title, in lines */
+
+/* Maximum depth to which submenus will be searched when looking for commands */
+#define MAX_MENU_DEPTH 8
+
+typedef struct menu_arg {
+    char *ma_doc;              /* Short doc for completion */
+    char *ma_prompt;           /* For prompting in menu */
+}        Menu_Arg;
+
+typedef struct menu_line {
+    int (*ml_function) ();
+    struct menu *ml_submenu;
+    int ml_argc;
+    struct menu_arg ml_args[MAX_ARGC];
+}         Menu_Line;
+
+#define ml_doc ml_args[0].ma_prompt
+#define ml_command ml_args[0].ma_doc
+
+typedef struct menu {
+    int (*m_entry) ();
+    int (*m_exit) ();
+    char *m_title;
+    int m_length;
+    struct menu_line m_lines[MAX_LINES];
+}    Menu;
+
+/* Return codes for Do_menu */
+/* These should also be used by functions called from Do_menu */
+#define DM_NORMAL 0            /* Normal return */
+#define DM_QUIT 1              /* Quit; ^C or q command received */
+
+/* Macros for initializing menu lines */
+#define NULLFUNC ((int (*)()) 0)
+#define NULLMENU ((struct menu *) 0)
+#define SUBMENU(cmd, doc, menu) { NULLFUNC, menu, 1, { { cmd, doc } } }
+#define SIMPLEFUNC(cmd, doc, func) { func, NULLMENU, 1, { { cmd, doc } } }
diff --git a/include/Makefile b/include/Makefile
new file mode 100644 (file)
index 0000000..d556ed2
--- /dev/null
@@ -0,0 +1,19 @@
+# Makefile for SMS 2.0 include files
+#
+#      $Source$
+#      $Header$
+#      $Author$
+#
+# (c) Copyright 1988 by the Massachusetts Institute of Technology.
+# For copying and distribution information, please see the file
+# <mit-copyright.h>.
+
+DESTDIR=
+FILES= sms.h sms_app.h sms_et.h
+
+all:
+
+install: ${FILES}
+       install -m 644 sms.h ${DESTDIR}/usr/include/sms.h
+       install -m 644 sms_app.h ${DESTDIR}/usr/include/sms_app.h
+       install -m 644 sms_et.h ${DESTDIR}/usr/include/sms_et.h
This page took 1.449115 seconds and 5 git commands to generate.