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 00050 int is_input; 00051 00053 struct io_data *next; 00054 } 00055 io_data_t; 00056 00057 00061 io_data_t *io_add( io_data_t *first_chain, io_data_t *decond_chain ); 00062 00066 io_data_t *io_remove( io_data_t *list, io_data_t *element ); 00067 00071 io_data_t *io_duplicate( void *context, io_data_t *l ); 00072 00076 io_data_t *io_get( io_data_t *io, int fd ); 00077 00078 00079 00083 void io_buffer_destroy( io_data_t *io_buffer ); 00084 00094 io_data_t *io_buffer_create( int is_input ); 00095 00099 void io_buffer_read( io_data_t *d ); 00100 00104 void io_print( io_data_t *io ); 00105 00106 #endif
1.5.6