1 /* sane - Scanner Access Now Easy. 2 Copyright (C) 1997-1999 David Mosberger-Tang and Andreas Beck 3 This file is part of the SANE package. 4 5 This file is in the public domain. You may use and modify it as 6 you see fit, as long as this copyright message is included and 7 that there is an indication as to what modifications have been 8 made (if any). 9 10 SANE is distributed in the hope that it will be useful, but WITHOUT 11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 FITNESS FOR A PARTICULAR PURPOSE. 13 14 This file declares SANE application interface. See the SANE 15 standard for a detailed explanation of the interface. */ 16 17 #ifndef sanei_net_h 18 #define sanei_net_h 19 20 #include <sane/sane.h> 21 #include <sane/sanei_wire.h> 22 23 #define SANEI_NET_PROTOCOL_VERSION 3 24 25 typedef enum 26 { 27 SANE_NET_LITTLE_ENDIAN = 0x1234, 28 SANE_NET_BIG_ENDIAN = 0x4321 29 } 30 SANE_Net_Byte_Order; 31 32 typedef enum 33 { 34 SANE_NET_INIT = 0, 35 SANE_NET_GET_DEVICES, 36 SANE_NET_OPEN, 37 SANE_NET_CLOSE, 38 SANE_NET_GET_OPTION_DESCRIPTORS, 39 SANE_NET_CONTROL_OPTION, 40 SANE_NET_GET_PARAMETERS, 41 SANE_NET_START, 42 SANE_NET_CANCEL, 43 SANE_NET_AUTHORIZE, 44 SANE_NET_EXIT 45 } 46 SANE_Net_Procedure_Number; 47 48 typedef struct 49 { 50 SANE_Word version_code; 51 SANE_String username; 52 } 53 SANE_Init_Req; 54 55 typedef struct 56 { 57 SANE_Status status; 58 SANE_Word version_code; 59 } 60 SANE_Init_Reply; 61 62 typedef struct 63 { 64 SANE_Status status; 65 SANE_Device **device_list; 66 } 67 SANE_Get_Devices_Reply; 68 69 typedef struct 70 { 71 SANE_Status status; 72 SANE_Word handle; 73 SANE_String resource_to_authorize; 74 } 75 SANE_Open_Reply; 76 77 typedef struct 78 { 79 SANE_Word num_options; 80 SANE_Option_Descriptor **desc; 81 } 82 SANE_Option_Descriptor_Array; 83 84 typedef struct 85 { 86 SANE_Word handle; 87 SANE_Word option; 88 SANE_Word action; 89 SANE_Word value_type; 90 SANE_Word value_size; 91 void *value; 92 } 93 SANE_Control_Option_Req; 94 95 typedef struct 96 { 97 SANE_Status status; 98 SANE_Word info; 99 SANE_Word value_type; 100 SANE_Word value_size; 101 void *value; 102 SANE_String resource_to_authorize; 103 } 104 SANE_Control_Option_Reply; 105 106 typedef struct 107 { 108 SANE_Status status; 109 SANE_Parameters params; 110 } 111 SANE_Get_Parameters_Reply; 112 113 typedef struct 114 { 115 SANE_Status status; 116 SANE_Word port; 117 SANE_Word byte_order; 118 SANE_String resource_to_authorize; 119 } 120 SANE_Start_Reply; 121 122 typedef struct 123 { 124 SANE_String resource; 125 SANE_String username; 126 SANE_String password; 127 } 128 SANE_Authorization_Req; 129 130 extern void sanei_w_init_req (Wire *w, SANE_Init_Req *req); 131 extern void sanei_w_init_reply (Wire *w, SANE_Init_Reply *reply); 132 extern void sanei_w_get_devices_reply (Wire *w, SANE_Get_Devices_Reply *reply); 133 extern void sanei_w_open_reply (Wire *w, SANE_Open_Reply *reply); 134 extern void sanei_w_option_descriptor_array (Wire *w, 135 SANE_Option_Descriptor_Array *opt); 136 extern void sanei_w_control_option_req (Wire *w, SANE_Control_Option_Req *req); 137 extern void sanei_w_control_option_reply (Wire *w, 138 SANE_Control_Option_Reply *reply); 139 extern void sanei_w_get_parameters_reply (Wire *w, 140 SANE_Get_Parameters_Reply *reply); 141 extern void sanei_w_start_reply (Wire *w, SANE_Start_Reply *reply); 142 extern void sanei_w_authorization_req (Wire *w, SANE_Authorization_Req *req); 143 144 #endif /* sanei_net_h */ 145