]> mj.ucw.cz Git - libucw.git/blobdiff - lib/mainloop.h
Multi-part objects (with header and body separated by an empty line and terminated
[libucw.git] / lib / mainloop.h
index 025dbe7b4632cd59467694bda052df8648b2adc0..ffbf4e4d299096fa04889bf05ec1dcc21276cdfd 100644 (file)
@@ -11,6 +11,7 @@
 
 extern sh_time_t now;                          /* Current time */
 extern uns main_shutdown;
+extern clist main_timer_list, main_file_list, main_hook_list, main_process_list;
 
 /* User-defined fields are marked with [*], all other fields must be initialized to zero. */
 
@@ -54,8 +55,8 @@ enum main_file_err_cause {
 void file_add(struct main_file *fi);
 void file_chg(struct main_file *fi);
 void file_del(struct main_file *fi);
-void file_read(struct main_file *fi, byte *buf, uns len);
-void file_write(struct main_file *fi, byte *buf, uns len);
+void file_read(struct main_file *fi, void *buf, uns len);
+void file_write(struct main_file *fi, void *buf, uns len);
 void file_set_timeout(struct main_file *fi, sh_time_t expires);
 
 /* Hooks to be called in each iteration of the main loop */
@@ -73,8 +74,9 @@ void hook_del(struct main_hook *ho);
 
 struct main_process {
   cnode n;
-  int pid;
-  int status;                                  /* Exit status */
+  int pid;                                     /* Process id (0=not running) */
+  int status;                                  /* Exit status (-1=fork failed) */
+  byte status_msg[EXIT_STATUS_MSG_SIZE];
   void (*handler)(struct main_process *mp);    /* [*] Called when the process exits; process_del done automatically */
   void *data;                                  /* [*] For use by the handler */
 };