| 1 | /* assuan-defs.c - Internal definitions to Assuan |
| 2 | * Copyright (C) 2001 Free Software Foundation, Inc. |
| 3 | * |
| 4 | * This file is part of GnuPG. |
| 5 | * |
| 6 | * GnuPG 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 | * GnuPG 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA |
| 19 | */ |
| 20 | |
| 21 | #ifndef ASSUAN_DEFS_H |
| 22 | #define ASSUAN_DEFS_Hcxx . . $ `assuan/assuan-defs.h:22:9`! |
| 23 | |
| 24 | #include <sys/types.h> |
| 25 | #include "assuan.h"cxx . . $ `<file>/assuan/assuan.h`/ |
| 26 | |
| 27 | #define LINELENGTHcxx . . $ `assuan/assuan-defs.h:27:9`! ASSUAN_LINELENGTHcxx . . $ `assuan/assuan.h:91:9`! |
| 28 | |
| 29 | struct cmdtbl_scxx . . $ cmdtbl_s# { |
| 30 | const char *namecxx . . $ cmdtbl_s#name.; |
| 31 | int cmd_idcxx . . $ cmdtbl_s#cmd_id.; |
| 32 | int (*handlercxx . . $ cmdtbl_s#handler.)(ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT#, char *line); |
| 33 | }; |
| 34 | |
| 35 | struct assuan_context_scxx . . $ assuan_context_s# { |
| 36 | AssuanErrorcxx . . $ AssuanError# err_nocxx . . $ assuan_context_s#err_no.; |
| 37 | const char *err_strcxx . . $ assuan_context_s#err_str.; |
| 38 | int os_errnocxx . . $ assuan_context_s#os_errno.; /* last system error number used with certain error codes*/ |
| 39 | |
| 40 | int confidentialcxx . . $ assuan_context_s#confidential.; |
| 41 | int is_servercxx . . $ assuan_context_s#is_server.; /* set if this is context belongs to a server */ |
| 42 | int in_inquirecxx . . $ assuan_context_s#in_inquire.; |
| 43 | char *hello_linecxx . . $ assuan_context_s#hello_line.; |
| 44 | char *okay_linecxx . . $ assuan_context_s#okay_line.; /* see assan_set_okay_line() */ |
| 45 | |
| 46 | void *user_pointercxx . . $ assuan_context_s#user_pointer.; /* for assuan_[gs]et_pointer () */ |
| 47 | |
| 48 | FILEcxx . . $ FILE# *log_fpcxx . . $ assuan_context_s#log_fp.; |
| 49 | |
| 50 | structcxx . . $ assuan_context_s#$anonymous_type_0# { |
| 51 | int fdcxx . . $ assuan_context_s#$anonymous_type_0#fd.; |
| 52 | int eofcxx . . $ assuan_context_s#$anonymous_type_0#eof.; |
| 53 | char linecxx . . $ assuan_context_s#$anonymous_type_0#line.[LINELENGTHcxx . . $ `assuan/assuan-defs.h:27:9`!]; |
| 54 | int linelencxx . . $ assuan_context_s#$anonymous_type_0#linelen.; /* w/o CR, LF - might not be the same as |
| 55 | strlen(line) due to embedded nuls. However a nul |
| 56 | is always written at this pos */ |
| 57 | structcxx . . $ assuan_context_s#$anonymous_type_0#$anonymous_type_1# { |
| 58 | char linecxx . . $ assuan_context_s#$anonymous_type_0#$anonymous_type_1#line.[LINELENGTHcxx . . $ `assuan/assuan-defs.h:27:9`!]; |
| 59 | int linelencxx . . $ assuan_context_s#$anonymous_type_0#$anonymous_type_1#linelen. ; |
| 60 | int pendingcxx . . $ assuan_context_s#$anonymous_type_0#$anonymous_type_1#pending.; /* i.e. at least one line is available in the attic */ |
| 61 | } atticcxx . . $ assuan_context_s#$anonymous_type_0#attic.; |
| 62 | } inboundcxx . . $ assuan_context_s#inbound.; |
| 63 | |
| 64 | structcxx . . $ assuan_context_s#$anonymous_type_2# { |
| 65 | int fdcxx . . $ assuan_context_s#$anonymous_type_2#fd.; |
| 66 | structcxx . . $ assuan_context_s#$anonymous_type_2#$anonymous_type_3# { |
| 67 | FILEcxx . . $ FILE# *fpcxx . . $ assuan_context_s#$anonymous_type_2#$anonymous_type_3#fp.; |
| 68 | char linecxx . . $ assuan_context_s#$anonymous_type_2#$anonymous_type_3#line.[LINELENGTHcxx . . $ `assuan/assuan-defs.h:27:9`!]; |
| 69 | int linelencxx . . $ assuan_context_s#$anonymous_type_2#$anonymous_type_3#linelen.; |
| 70 | int errorcxx . . $ assuan_context_s#$anonymous_type_2#$anonymous_type_3#error.; |
| 71 | } datacxx . . $ assuan_context_s#$anonymous_type_2#data.; |
| 72 | } outboundcxx . . $ assuan_context_s#outbound.; |
| 73 | |
| 74 | int pipe_modecxx . . $ assuan_context_s#pipe_mode.; /* We are in pipe mode, i.e. we can handle just one |
| 75 | connection and must terminate then */ |
| 76 | pid_tcxx . . $ pid_t# pidcxx . . $ assuan_context_s#pid.; /* In pipe mode, the pid of the child server process. |
| 77 | In socket mode, the pid of the server */ |
| 78 | int listen_fdcxx . . $ assuan_context_s#listen_fd.; /* The fd we are listening on (used by socket servers) */ |
| 79 | |
| 80 | pid_tcxx . . $ pid_t# client_pidcxx . . $ assuan_context_s#client_pid.; /* for a socket server the PID of the client or -1 |
| 81 | if not available */ |
| 82 | |
| 83 | void (*deinit_handlercxx . . $ assuan_context_s#deinit_handler.)(ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT#); |
| 84 | int (*accept_handlercxx . . $ assuan_context_s#accept_handler.)(ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT#); |
| 85 | int (*finish_handlercxx . . $ assuan_context_s#finish_handler.)(ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT#); |
| 86 | |
| 87 | struct cmdtbl_scxx . . $ cmdtbl_s# *cmdtblcxx . . $ assuan_context_s#cmdtbl.; |
| 88 | size_t cmdtbl_usedcxx . . $ assuan_context_s#cmdtbl_used.; /* used entries */ |
| 89 | size_t cmdtbl_sizecxx . . $ assuan_context_s#cmdtbl_size.; /* allocated size of table */ |
| 90 | |
| 91 | void (*bye_notify_fnccxx . . $ assuan_context_s#bye_notify_fnc.)(ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT#); |
| 92 | void (*reset_notify_fnccxx . . $ assuan_context_s#reset_notify_fnc.)(ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT#); |
| 93 | void (*cancel_notify_fnccxx . . $ assuan_context_s#cancel_notify_fnc.)(ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT#); |
| 94 | int (*option_handler_fnccxx . . $ assuan_context_s#option_handler_fnc.)(ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT#,const char*, const char*); |
| 95 | void (*input_notify_fnccxx . . $ assuan_context_s#input_notify_fnc.)(ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT#, const char *); |
| 96 | void (*output_notify_fnccxx . . $ assuan_context_s#output_notify_fnc.)(ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT#, const char *); |
| 97 | |
| 98 | int input_fdcxx . . $ assuan_context_s#input_fd.; /* set by INPUT command */ |
| 99 | int output_fdcxx . . $ assuan_context_s#output_fd.; /* set by OUTPUT command */ |
| 100 | |
| 101 | }; |
| 102 | |
| 103 | |
| 104 | /*-- assuan-pipe-server.c --*/ |
| 105 | int _assuan_new_contextcxx . . $ _assuan_new_context(644ebbdd931b9269). (ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT# *r_ctx); |
| 106 | void _assuan_release_contextcxx . . $ _assuan_release_context(746ddb6f27ff0333). (ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT# ctx); |
| 107 | |
| 108 | |
| 109 | /*-- assuan-handler.c --*/ |
| 110 | int _assuan_register_std_commandscxx . . $ _assuan_register_std_commands(29493cd997091d1). (ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT# ctx); |
| 111 | |
| 112 | /*-- assuan-buffer.c --*/ |
| 113 | int _assuan_read_linecxx . . $ _assuan_read_line(29493cd997091d1). (ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT# ctx); |
| 114 | int _assuan_cookie_write_datacxx . . $ _assuan_cookie_write_data(886e92dd2af22b63). (void *cookie, const char *buffer, size_t size); |
| 115 | int _assuan_cookie_write_flushcxx . . $ _assuan_cookie_write_flush(dedf1e9b1c614a07). (void *cookie); |
| 116 | |
| 117 | /*-- assuan-client.c --*/ |
| 118 | AssuanErrorcxx . . $ AssuanError# _assuan_read_from_servercxx . . $ _assuan_read_from_server(e2c6b8b75366ee23). (ASSUAN_CONTEXTcxx . . $ ASSUAN_CONTEXT# ctx, int *okay, int *off); |
| 119 | |
| 120 | |
| 121 | /*-- assuan-util.c --*/ |
| 122 | void *_assuan_malloccxx . . $ _assuan_malloc(bfcfa4d6b7f7ef64). (size_t n); |
| 123 | void *_assuan_calloccxx . . $ _assuan_calloc(63a7bf2941bfcd7a). (size_t n, size_t m); |
| 124 | void *_assuan_realloccxx . . $ _assuan_realloc(417ab160f6baadc6). (void *p, size_t n); |
| 125 | void _assuan_freecxx . . $ _assuan_free(5d22bdacc48458e8). (void *p); |
| 126 | |
| 127 | #define xtrymalloccxx . . $ `assuan/assuan-defs.h:127:9`!(a) _assuan_malloc ((a)) |
| 128 | #define xtrycalloccxx . . $ `assuan/assuan-defs.h:128:9`!(a,b) _assuan_calloc ((a),(b)) |
| 129 | #define xtryrealloccxx . . $ `assuan/assuan-defs.h:129:9`!(a,b) _assuan_realloc((a),(b)) |
| 130 | #define xfreecxx . . $ `assuan/assuan-defs.h:130:9`!(a) _assuan_free ((a)) |
| 131 | |
| 132 | #define set_errorcxx . . $ `assuan/assuan-defs.h:132:9`!(c,e,t) assuan_set_error ((c), ASSUAN_ ## e, (t)) |
| 133 | |
| 134 | void _assuan_log_print_buffercxx . . $ _assuan_log_print_buffer(4a34f311aa103ecc). (FILEcxx . . $ FILE# *fp, const void *buffer, size_t length); |
| 135 | void _assuan_log_sanitized_stringcxx . . $ _assuan_log_sanitized_string(85c52e162fed56f9). (const char *string); |
| 136 | |
| 137 | |
| 138 | #endif /*ASSUAN_DEFS_H*/ |
| 139 |