1 |
/* io.h - I/O functions |
2 |
* Copyright (C) 2000 Werner Koch (dd9jn) |
3 |
* |
4 |
* This file is part of MyGPGME. |
5 |
* |
6 |
* MyGPGME is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
8 |
* the Free Software Foundation; either version 2 of the License, or |
9 |
* (at your option) any later version. |
10 |
* |
11 |
* MyGPGME is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU General Public License |
17 |
* along with this program; if not, write to the Free Software |
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
19 |
*/ |
20 |
|
21 |
#ifndef GPGME_IO_H |
22 |
#define GPGME_IO_H |
23 |
|
24 |
#include "types.h" |
25 |
|
26 |
struct spawn_fd_item_s { |
27 |
int fd; |
28 |
int dup_to; |
29 |
}; |
30 |
|
31 |
|
32 |
struct io_select_fd_s { |
33 |
int fd; |
34 |
int is_closed; |
35 |
int for_read; |
36 |
int for_write; |
37 |
int signaled; |
38 |
int frozen; |
39 |
void *opaque; |
40 |
}; |
41 |
|
42 |
|
43 |
/* These function are either defined in posix-io.c or w32-io.c */ |
44 |
|
45 |
int _gpgme_io_read ( int fd, void *buffer, size_t count ); |
46 |
int _gpgme_io_write ( int fd, const void *buffer, size_t count ); |
47 |
int _gpgme_io_pipe ( int filedes[2], int inherit_idx ); |
48 |
int _gpgme_io_close ( int fd ); |
49 |
int _gpgme_io_set_close_notify (int fd, |
50 |
void (*handler)(int, void*), void *value); |
51 |
int _gpgme_io_set_nonblocking ( int fd ); |
52 |
ulong _gpgme_io_spawn ( const char *path, char **argv, |
53 |
struct spawn_fd_item_s *fd_child_list, |
54 |
struct spawn_fd_item_s *fd_parent_list ); |
55 |
int _gpgme_io_waitpid ( int pid, int hang, int *r_status, int *r_signal ); |
56 |
int _gpgme_io_kill ( int pid, int hard ); |
57 |
int _gpgme_io_select ( struct io_select_fd_s *fds, size_t nfds); |
58 |
|
59 |
#endif /* GPGME_IO_H */ |