replaced 'activate' with 'schedule'
[rxpd] / rxpd.h
diff --git a/rxpd.h b/rxpd.h
index e60e8e0..ccfa107 100644 (file)
--- a/rxpd.h
+++ b/rxpd.h
 #include <arpa/inet.h>
 #include <event.h>
 
-#define RXPD_COMMANDS                           \
-  RXPD_CMD(CHECK)                               \
-  RXPD_CMD(APPEND)                              \
-  RXPD_CMD(PREPEND)                             \
-  RXPD_CMD(REMOVE)                              \
-  RXPD_CMD(REPLACE)                             \
-  RXPD_CMD(LOAD)                                \
-  RXPD_CMD(SAVE)                                \
-  RXPD_CMD(DUMP)                                \
-  RXPD_CMD(LIST)                                \
-  RXPD_CMD(END)                                 \
+#define RXPD_COMMANDS   \
+  RXPD_CMD(CHECK)       \
+  RXPD_CMD(APPEND)      \
+  RXPD_CMD(PREPEND)     \
+  RXPD_CMD(REMOVE)      \
+  RXPD_CMD(REPLACE)     \
+  RXPD_CMD(LOAD)        \
+  RXPD_CMD(SAVE)        \
+  RXPD_CMD(DUMP)        \
+  RXPD_CMD(LIST)        \
+  RXPD_CMD(SHUTDOWN)
 
 #define RXPD_CMD(cmd) RXPD_CMD_##cmd,
-enum {RXPD_COMMANDS};
+enum rxpd_cmd_e {RXPD_COMMANDS};
 #undef RXPD_CMD
 
 struct rxpd_base;
@@ -105,12 +105,15 @@ struct rxpd_file
   llist rules;
 };
 
-int
-rxpd_file_load (struct rxpd_base* base, const char* filename);
+struct rxpd_file*
+rxpd_file_new (struct rxpd_base* base, const char* filename);
 
 void
 rxpd_file_delete (PSplay file);
 
+int
+rxpd_file_load (struct rxpd_file* self);
+
 int
 rxpd_file_cmp (const void* A, const void* B);
 
@@ -139,7 +142,7 @@ void
 rxpd_socket_accept (int sock, short event, void* ptr);
 
 struct rxpd_socket*
-rxpd_socket_activate (struct rxpd_socket* self);
+rxpd_socket_schedule (struct rxpd_socket* self);
 
 struct rxpd_socket*
 rxpd_socket_suspend (struct rxpd_socket* self);
@@ -200,7 +203,7 @@ rxpd_connection_delete (struct rxpd_connection* self);
 
 
 struct rxpd_connection*
-rxpd_connection_activate (struct rxpd_connection* self);
+rxpd_connection_schedule (struct rxpd_connection* self);
 
 
 struct rxpd_connection*
@@ -211,10 +214,10 @@ int
 rxpd_connection_readline (struct rxpd_connection* self);
 
 void
-rxpd_connection_parse_cmd (int sock, short event, void* ptr);
+rxpd_connection_parse_cmd (int fd, short event, void* ptr);
 
 /* generate prototypes for each defined command */
-#define RXPD_CMD(cmd) void rxpd_connection_cmd_##cmd (int sock, short event, void* ptr);
+#define RXPD_CMD(cmd) void rxpd_connection_cmd_##cmd (int fd, short event, void* ptr);
 RXPD_COMMANDS
 #undef RXPD_CMD