APPEND/PREPEND commands
[rxpd] / rxpd.h
diff --git a/rxpd.h b/rxpd.h
index 43d0185..7aca557 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)
+#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_cmd_e {RXPD_COMMANDS};
@@ -99,7 +100,8 @@ rxpd_rule_delete (struct rxpd_rule*);
 //
 struct rxpd_file
 {
-  psplay node;
+  psplay node;          // key points to basename part of filename
+  const char* filename; // full filename
   //TODO later     struct stat last_stat;
   llist rules;
 };
@@ -141,7 +143,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);
@@ -186,6 +188,7 @@ struct rxpd_connection
   struct event ev;
   struct rxpd_base* base;
   struct rxpd_file* file;
+  llist tmp_list;
 
   struct sockaddr peer_addr;
 
@@ -202,7 +205,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*