diff options
author | Marcus Brinkmann <[email protected]> | 2008-06-18 14:46:05 +0000 |
---|---|---|
committer | Marcus Brinkmann <[email protected]> | 2008-06-18 14:46:05 +0000 |
commit | 02bc6e886c5248a5019298f72c26703f548a4533 (patch) | |
tree | e2be552a6013faeb591eba46f6ce9150631cbe01 /common/sysutils.h | |
parent | Add controlo statement %ask-passphrase (diff) | |
download | gnupg-02bc6e886c5248a5019298f72c26703f548a4533.tar.gz gnupg-02bc6e886c5248a5019298f72c26703f548a4533.zip |
2008-06-18 Marcus Brinkmann <[email protected]>
* sysutils.h (translate_table_init, translate_table_lookup): New
prototypes.
* sysutils.c: Include <ctype.h>.
(FD_TRANSLATE_MAX): New macro.
(fd_translate, fd_translate_len): New static variables.
(translate_table_init, translate_table_lookup): New functions.
(translate_sys2libc_fd_int): Translate file descriptor.
* iobuf.c (check_special_filename): Translate handle values from
special filenames.
Diffstat (limited to '')
-rw-r--r-- | common/sysutils.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/sysutils.h b/common/sysutils.h index de1e3bb1e..9e0a323dd 100644 --- a/common/sysutils.h +++ b/common/sysutils.h @@ -43,6 +43,16 @@ int enable_core_dumps (void); const unsigned char *get_session_marker (size_t *rlen); /*int check_permissions (const char *path,int extension,int checkonly);*/ void gnupg_sleep (unsigned int seconds); + +/* Initialize the fd translation table. This reads one line from + stdin which is expected to be in the format "FROM TO [...]" where + each "FROM TO" pair are two handle numbers. Handle number FROM on + the command line is translated to handle number TO. */ +void translate_table_init (void); + +/* Translate a handle number. */ +int translate_table_lookup (int fd); + int translate_sys2libc_fd (gnupg_fd_t fd, int for_write); int translate_sys2libc_fd_int (int fd, int for_write); FILE *gnupg_tmpfile (void); |