/usr/include/xview/sel_svc.h is in xviewg-dev 3.2p1.4-28.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | /* @(#)sel_svc.h 20.35 93/06/28 SMI */
#ifndef xview_selection_svc_DEFINED
#define xview_selection_svc_DEFINED
/*
* (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents
* pending in the U.S. and foreign countries. See LEGAL NOTICE
* file for terms of the license.
*/
/*
***********************************************************************
* Include Files
***********************************************************************
*/
#include <netinet/in.h>
#include <xview/server.h>
#include <xview/win_input.h>
#include <xview/sel_attrs.h>
#include <xview/pkg.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <X11/Xatom.h>
#include <rpc/rpc.h>
/*
***********************************************************************
* Definitions and Macros
***********************************************************************
*/
/*
* PUBLIC #defines
*/
#ifdef TRUE
#undef TRUE
#define TRUE 1
#endif
#ifdef FALSE
#undef FALSE
#define FALSE 0
#endif
#define SELN_REPORT(event) seln_report_event(0, event)
/*
* routines & data for keeping track of the state of the function keys
*/
#define selection_function_pending(server) \
server_get_seln_function_pending(server)
#define seln_function_clear(server) \
server_set_seln_function_pending(server, 0)
/*
* possibly useful predicates
*/
#define seln_holder_is_me(client, holder) \
(seln_holder_same_client(client, holder))
/*
* PRIVATE #defines
*/
#define SELN_FUNCTION_WORD_COUNT 8 /* 256 bits should last a while */
#define SELN_RPC_BUFSIZE 2048
#define SELN_BUFSIZE (SELN_RPC_BUFSIZE \
- 128 \
- sizeof(Seln_replier_data *) \
- sizeof(Seln_requester) \
- sizeof(char *) \
- sizeof(Seln_rank) \
- sizeof(Seln_result) \
- sizeof(unsigned))
/*
***********************************************************************
* Typedefs, Enumerations, and Structures
***********************************************************************
*/
/*
* Seln_client: opaque handle returned to client from create
*/
typedef char *Seln_client;
/*
* PUBLIC enums
*/
/*
* Seln_result: Standard return codes
*/
typedef enum {
SELN_FAILED, SELN_SUCCESS, /* the basic all-around uses */
SELN_NON_EXIST, SELN_DIDNT_HAVE, SELN_WRONG_RANK, /* special cases */
SELN_CONTINUED, SELN_CANCEL, SELN_UNRECOGNIZED,
SELN_OVER
} Seln_result;
/*
* Seln_rank: Selection identifiers
*/
typedef enum {
SELN_UNKNOWN = 0,
SELN_CARET = 1,
SELN_PRIMARY = 2,
SELN_SECONDARY = 3,
SELN_SHELF = 4,
SELN_UNSPECIFIED = 5
} Seln_rank;
/*
* Seln_function: Modes which affect rank of selection,
* controlled by function-keys or their programmatic equivalents
*/
typedef enum {
SELN_FN_ERROR = 0,
SELN_FN_STOP = 1, SELN_FN_AGAIN = 2,
SELN_FN_PROPS = 3, SELN_FN_UNDO = 4,
SELN_FN_FRONT = 5, SELN_FN_PUT = 6,
SELN_FN_OPEN = 7, SELN_FN_GET = 8,
SELN_FN_FIND = 9, SELN_FN_DELETE = 10
} Seln_function;
#define SELN_FN_COPY SELN_FN_PUT
#define SELN_FN_PASTE SELN_FN_GET
#define SELN_FN_CUT SELN_FN_DELETE
/*
* Seln_state: States a selection (or its holder) may be in
*/
typedef enum {
SELN_NONE, SELN_EXISTS, SELN_FILE
} Seln_state;
/*
* Seln_response: possible appropriate responses to a Seln_function_buffer
*/
typedef enum {
SELN_IGNORE, SELN_REQUEST, SELN_FIND, SELN_SHELVE, SELN_DELETE
} Seln_response;
/*
* PUBLIC structs
*/
/*
* Seln_access for SunView 1 compatibility
* (cannot be moved below because Seln_holder depends upon it)
*/
typedef struct {
int pid;
int program;
struct sockaddr_in tcp_address;
struct sockaddr_in udp_address;
char *client;
} Seln_access;
typedef struct {
Seln_rank rank;
Seln_state state;
Seln_access access;
} Seln_holder;
typedef struct {
Seln_holder caret;
Seln_holder primary;
Seln_holder secondary;
Seln_holder shelf;
} Seln_holders_all;
typedef struct {
Seln_function function;
Seln_rank addressee_rank;
Seln_holder caret;
Seln_holder primary;
Seln_holder secondary;
Seln_holder shelf;
} Seln_function_buffer;
typedef struct {
char *client_data;
Seln_rank rank;
char *context;
char **request_pointer;
char **response_pointer;
} Seln_replier_data;
typedef struct {
Seln_result (*consume)();
char *context;
} Seln_requester;
typedef struct {
Seln_replier_data *replier;
Seln_requester requester;
char *addressee;
Seln_rank rank;
Seln_result status;
unsigned buf_size;
char data[SELN_BUFSIZE];
} Seln_request;
/*
* PUBLIC structs
* For SunView 1 compatibility
*/
typedef struct {
Seln_rank rank;
char *pathname;
} Seln_file_info;
typedef struct {
Seln_holder holder;
Seln_function function;
int down;
} Seln_inform_args;
typedef struct {
unsigned data[SELN_FUNCTION_WORD_COUNT];
} Seln_functions_state;
/*
***********************************************************************
* Globals
***********************************************************************
*/
/*
* PUBLIC variables
*/
/*
* null structs for initialization & easy reference
*/
extern Seln_function_buffer
seln_null_function;
extern Seln_holder seln_null_holder;
extern Seln_request seln_null_request;
/*
* PUBLIC functions
*/
EXTERN_FUNCTION (Seln_rank selection_acquire, (Xv_Server server, Seln_client seln_client, Seln_rank asked));
EXTERN_FUNCTION (Seln_request * selection_ask, (Xv_Server server, Seln_holder *holder, DOTDOTDOT));
EXTERN_FUNCTION (void selection_clear_functions, (Xv_Server server));
EXTERN_FUNCTION (Seln_client selection_create, (Xv_Server server, void (*func)(Xv_opaque, Seln_function_buffer *), Seln_result (*request_proc)( Seln_attribute, Seln_replier_data *, int), char *client_data));
EXTERN_FUNCTION (void selection_destroy, (Xv_Server server, Seln_client client));
EXTERN_FUNCTION (Seln_result selection_done, (Xv_Server server, Seln_client seln_client, Seln_rank rank));
EXTERN_FUNCTION (Seln_response selection_figure_response, (Xv_Server server, Seln_function_buffer *buffer, Seln_holder **holder));
EXTERN_FUNCTION (Seln_result selection_hold_file, (Xv_Server server, Seln_rank rank, char *path));
EXTERN_FUNCTION (Seln_function_buffer selection_inform, (Xv_Server server, Seln_client seln_client, Seln_function which, int down));
EXTERN_FUNCTION (void selection_init_request, (Xv_Server server, Seln_request *buffer, Seln_holder *holder, DOTDOTDOT));
EXTERN_FUNCTION (Seln_holder selection_inquire, (Xv_Server server, Seln_rank which));
EXTERN_FUNCTION (Seln_holders_all selection_inquire_all, (Xv_Server server));
EXTERN_FUNCTION (Seln_result selection_query, (Xv_Server server, Seln_holder *holder, Seln_result (*reader)(Seln_request *), char *context, DOTDOTDOT));
EXTERN_FUNCTION (void selection_report_event, (Xv_Server server, Seln_client seln_client, Event *event));
EXTERN_FUNCTION (Seln_result selection_request, (Xv_Server server, Seln_holder *holder, Seln_request *buffer));
EXTERN_FUNCTION (void selection_use_timeout, (Xv_Server server, int seconds));
EXTERN_FUNCTION (void selection_yield_all, (Xv_Server server));
EXTERN_FUNCTION (Seln_client seln_create, (void (*func_proc)(), Seln_result (*request_proc)(), char *client_data));
EXTERN_FUNCTION (Seln_function_buffer seln_inform, (Seln_client seln_client, Seln_function which, int down));
EXTERN_FUNCTION (Seln_holder seln_inquire, (Seln_rank which));
EXTERN_FUNCTION (Seln_holders_all seln_inquire_all, (void));
EXTERN_FUNCTION (Seln_rank seln_acquire, (Seln_client seln_client, Seln_rank asked));
EXTERN_FUNCTION (Seln_request *seln_ask, (Seln_holder *holder, DOTDOTDOT));
EXTERN_FUNCTION (Seln_response seln_figure_response, (Seln_function_buffer *buffer, Seln_holder **holder));
EXTERN_FUNCTION (Seln_result seln_done, (Seln_client seln_client, Seln_rank rank));
EXTERN_FUNCTION (Seln_result seln_hold_file, (Seln_rank rank, char *path));
EXTERN_FUNCTION (Seln_result seln_query, (Seln_holder *holder, Seln_result (*reader)(), char *context, DOTDOTDOT));
EXTERN_FUNCTION (Seln_result seln_request, (Seln_holder *holder, Seln_request *buffer));
EXTERN_FUNCTION (void seln_report_event, (Seln_client seln_client, Event *event));
EXTERN_FUNCTION (void seln_yield_all, (void));
EXTERN_FUNCTION (void seln_destroy, (Seln_client client));
EXTERN_FUNCTION (int seln_holder_same_client, (Seln_holder *holder, char *client_data));
EXTERN_FUNCTION (int seln_holder_same_process, (Seln_holder *holder));
EXTERN_FUNCTION (int seln_secondary_made, (Seln_function_buffer *buffer));
EXTERN_FUNCTION (int seln_secondary_exists, (Seln_function_buffer *buffer));
EXTERN_FUNCTION (void seln_init_request, (Seln_request *buffer, Seln_holder *holder, DOTDOTDOT));
EXTERN_FUNCTION (void seln_clear_functions, (void));
EXTERN_FUNCTION (void seln_use_timeout, (int seconds));
#endif /* ~xview_selection_svc_DEFINED */
|