]> andersk Git - moira.git/blobdiff - server/mr_server.h
Code style cleanup. (No functional changes)
[moira.git] / server / mr_server.h
index 6feb16a9b74e7d77c6ba11a83f4263a8a75497f7..0821036d998b667097acdce59f4d96ab93e703f7 100644 (file)
 #include "mr_proto.h"
 #include <moira_site.h>
 #include <krb.h>
+#include <com_err.h>
+#include <stdlib.h>
+#include <stdarg.h>
 
 typedef struct returned_tuples {
-       struct returned_tuples *next;
-       OPERATION op;
-       mr_params *retval;
+  struct returned_tuples *next;
+  OPERATION op;
+  mr_params *retval;
 } returned_tuples;
 
 /*
@@ -26,9 +29,9 @@ typedef struct returned_tuples {
  */
 
 struct krbname {
-       char name[ANAME_SZ];
-       char inst[INST_SZ];
-       char realm[REALM_SZ];
+  char name[ANAME_SZ];
+  char inst[INST_SZ];
+  char realm[REALM_SZ];
 };
 
 /*
@@ -37,19 +40,19 @@ struct krbname {
  */
 
 typedef struct _client {
-       OPERATION pending_op;   /* Primary pending operation */
-       CONNECTION con;         /* Connection to the client */
-       int action;             /* what action is pending? */
-       mr_params *args, reply;
-       int id;                 /* Unique id of client */
-       struct sockaddr_in haddr; /* IP address of client */
-       char clname[MAX_K_NAME_SZ];/* Name client authenticated to */
-       struct krbname kname;   /* Parsed version of the above */
-       int users_id;           /* MR internal ID of authenticated user */
-       int client_id;          /* MR internal ID of client for modby field */
-       returned_tuples *first, *last;
-       time_t last_time_used;  /* Last time connection used */
-       char entity[9];         /* entity on other end of the connection */
+  OPERATION pending_op;                /* Primary pending operation */
+  CONNECTION con;              /* Connection to the client */
+  int action;                  /* what action is pending? */
+  mr_params *args, reply;
+  int id;                      /* Unique id of client */
+  struct sockaddr_in haddr;    /* IP address of client */
+  char clname[MAX_K_NAME_SZ];  /* Name client authenticated to */
+  struct krbname kname;        /* Parsed version of the above */
+  int users_id;                        /* MR internal ID of authenticated user */
+  int client_id;               /* MR internal ID of client for modby field */
+  returned_tuples *first, *last;
+  time_t last_time_used;       /* Last time connection used */
+  char entity[9];              /* entity on other end of the connection */
 } client;
 
 /*
@@ -87,6 +90,8 @@ extern int log_flags;
 
 /* max length of query argument allowed */
 #define ARGLEN 257
+/* Used to setup static argv, maximum argc */
+#define QMAXARGS       22
 
 /* statistics on number of queries by version number */
 extern int newqueries, oldqueries;
@@ -106,3 +111,84 @@ extern int dormant;
 extern int inc_running, inc_pid;
 extern time_t inc_started, now;
 #define INC_TIMEOUT (3 * 60)   /* 3 minutes */
+
+
+#define SQL_NO_MATCH 1403 /* oracle, not ingres (= 100) */
+
+/* prototypes from gdb */
+int gdb_init(void);
+int gdb_debug(int flag);
+void start_accepting_client(CONNECTION, OPERATION, CONNECTION *,
+                            char *, int *, TUPLE *);
+int initialize_operation(OPERATION, int (*init_function)(), char *,
+                        int (*cancel_function)());
+int reset_operation(OPERATION);
+int delete_operation(OPERATION);
+int start_replying_to_client(OPERATION, CONNECTION, int, char *, char *);
+int op_select(LIST_OF_OPERATIONS, int, fd_set *, fd_set *, fd_set *,
+             struct timeval *);
+
+/* prototypes from libmoira */
+struct save_queue *sq_create(void);
+int sq_save_data(struct save_queue *sq, void *data);
+int sq_save_unique_data(struct save_queue *sq, void *data);
+int sq_save_args(int argc, void *argv[], struct save_queue *sq);
+int sq_get_data(struct save_queue *sq, void *data);
+int sq_remove_data(struct save_queue *sq, void *data);
+int sq_empty(struct save_queue *sq);
+void sq_destroy(struct save_queue *sq);
+
+void send_zgram(char *instance, char *buf);
+void critical_alert(char *, char *, ...);
+void mr_destroy_reply(mr_params *reply);
+int gdss2et(int);
+
+/* prototypes from increment.dc */
+void incremental_init(void);
+void next_incremental(void);
+void incremental_update(void);
+void incremental_flush(void);
+
+/* prototypes from qrtn.dc */
+void dbmserr(void);
+void dosql(char *buffers[]);
+int mr_open_database(void);
+void mr_close_database(void);
+int mr_process_query(client *cl, char *name, int argc, char *argv_ro[],
+                    int (*action)(), char *actarg);
+int mr_check_access(client *cl, char *name, int argc, char *argv_ro[]);
+void sanity_check_queries(void);
+int set_krb_mapping(char *name, char *login, int ok, int *kid, int *uid);
+int find_member(char *list_type, int list_id, client *cl);
+int do_for_all_rows(char *query, int count, int (*action)(), int actarg);
+int build_qual(char *fmt, int argc, char *argv[], char *qual);
+
+
+/* prototyoes from qsupport.dc */
+int set_pop_usage(int id, int cnt);
+
+/* prototypes from qvalidate.dc */
+void sanity_check_database(void);
+int add_string(char *name);
+int convert_wildcards(char *arg);
+
+/* prototypes from mr_main.c */
+void clist_delete(client *cp);
+
+/* prototypes from mr_sauth.c */
+void do_auth(client *cl);
+
+/* prototypes from mr_scall.c */
+void do_client(client *cp);
+int trigger_dcm(int dummy0, int dummy1, client *cl);
+
+/* prototypes from mr_shutdown.c */
+void sigshut(int);
+void do_shutdown(client *cl);
+
+/* prototypes from mr_util.c */
+char *requote(char *buf, char *cp, int len);
+void log_args(char *tag, int version, int argc, char **argv);
+void mr_com_err(const char *whoami, long code, const char *fmt, va_list pvar);
+int mr_trim_args(int argc, char **argv);
+char **mr_copy_args(char **argv, int argc);
This page took 0.843302 seconds and 4 git commands to generate.