#ifndef WH_LX_XI_H_5c9f34f9_ #define WH_LX_XI_H_5c9f34f9_ #include /* * The LX eXtension Interface, the API used by extension * implementations. These are interfaces designed for use by * extensions, not by client programs. (Extensions may also find some * of the client-program interfaces useful.) * * Any identifier beginning lxxi__ or LXXI__ should be considered * internal to the implementation. Use of such identifiers is * dangerous, unsupported, and very much "at your own risk". */ typedef unsigned int CARD32; typedef unsigned short int CARD16; typedef unsigned char CARD8; typedef signed int INT32; typedef signed short int INT16; /* * lxxi_internal_op returns an LX_OP suitable for returning to client * code when the implementation needs to do behind-the-scenes work. * lxxi_op_finished should be called on such an LX_OP to indicate to * the client code that the op has completed. * * lxxi_predone_op returns an LX_OP which has already completed. This * is suitable for use when a call is made but the operation can be * completed without a server round-trip. */ extern LX_OP *lxxi_internal_op(LX_CONN *); extern void lxxi_op_finished(LX_OP *); extern LX_OP *lxxi_predone_op(LX_CONN *); /* * Reading and writing multi-byte packet values. * * lxxi_[rw]_{card,int}{16,32} read (r) and write (w) signed (int) or * unsigned (card) 16- (16) or 32- (32) -bit data. The read versions * are passed a pointer to the first byte and return the value; the * write versions are passed the pointer and the value and return * nothing. */ extern CARD16 lxxi_r_card16(const unsigned char *); extern CARD32 lxxi_r_card32(const unsigned char *); extern INT16 lxxi_r_int16(const unsigned char *); extern INT32 lxxi_r_int32(const unsigned char *); extern void lxxi_w_card16(unsigned char *, CARD16); extern void lxxi_w_card32(unsigned char *, CARD32); extern void lxxi_w_int16(unsigned char *, INT16); extern void lxxi_w_int32(unsigned char *, INT32); /* * Report a protocol error. */ extern void lxxi_protoerr(LX_CONN *, const char *, ...) __attribute__((__format__(__printf__,2,3))); /* * Report a bad-call error. The first arg is the connection, the * second, the call name. (The connection is needed in order to * locate the correct error handler to call.) */ extern void lxxi_bad_call(LX_CONN *, const char *); /* * Return the LX_CONN for an LX_OIP. */ extern LX_CONN *lxxi_op_conn(LX_OP *); /* * Send a request and expect a reply. * * lxxi_expect_reply(xc,req,len,done,donearg) * * xc is the connection, of course. req and len describe the request * (len is in bytes). done is the function to be called when a reply * is received; donearg is passed as the third arg to done but is * otherwise unused. */ extern LX_OP *lxxi_expect_reply(LX_CONN *, const unsigned char *, int, void (*)(LX_OP *, const unsigned char *, void *), void *); #endif