00001 #ifndef FISH_IO_H 00002 #define FISH_IO_H 00003 00007 enum io_mode 00008 { 00009 IO_FILE, IO_PIPE, IO_FD, IO_BUFFER, IO_CLOSE 00010 } 00011 ; 00012 00014 typedef struct io_data 00015 { 00017 int io_mode; 00019 int fd; 00023 union 00024 { 00026 int pipe_fd[2]; 00028 wchar_t *filename; 00030 int old_fd; 00031 } param1 00032 ; 00036 union 00037 { 00039 int flags; 00041 buffer_t *out_buffer; 00043 int close_old; 00044 } param2 00045 ; 00046 00047 int is_input; 00048 00050 struct io_data *next; 00051 } 00052 io_data_t; 00053 00054 00058 io_data_t *io_add( io_data_t *first_chain, io_data_t *decond_chain ); 00059 00063 io_data_t *io_remove( io_data_t *list, io_data_t *element ); 00064 00068 io_data_t *io_duplicate( void *context, io_data_t *l ); 00069 00073 io_data_t *io_get( io_data_t *io, int fd ); 00074 00075 00076 00080 void io_buffer_destroy( io_data_t *io_buffer ); 00081 00091 io_data_t *io_buffer_create( int is_input ); 00092 00096 void io_buffer_read( io_data_t *d ); 00097 00101 void io_print( io_data_t *io ); 00102 00103 #endif
1.4.4