38# if defined(PKG_DLL_EXPORTS) && defined(PKG_DLL_IMPORTS)
39# error "Only PKG_DLL_EXPORTS or PKG_DLL_IMPORTS can be defined, not both."
40# elif defined(PKG_DLL_EXPORTS)
41# define PKG_EXPORT COMPILER_DLLEXPORT
42# elif defined(PKG_DLL_IMPORTS)
43# define PKG_EXPORT COMPILER_DLLIMPORT
54#define PKG_STDIO_MODE -3
78#define PKG_MAGIC 0x41FE
85#define PKG_STREAMLEN (32*1024)
112#define PKC_NULL ((struct pkg_conn *)0)
113#define PKC_ERROR ((struct pkg_conn *)(-1L))
119#define pkg_send_vls(type, vlsp, pkg) \
120 pkg_send( (type), bu_vls_addr((vlsp)), bu_vls_strlen((vlsp))+1, (pkg) )
128PKG_EXPORT
extern struct pkg_conn *
pkg_open(
const char *host,
const char *service,
const char *protocol,
const char *username,
const char *passwd,
const struct pkg_switch* switchp,
pkg_errlog errlog);
188PKG_EXPORT
extern int pkg_2send(
int type,
const char *buf1,
size_t len1,
const char *buf2,
size_t len2,
struct pkg_conn* pc);
324PKG_EXPORT
extern char *
pkg_pshort(
char *buf,
unsigned short s);
329PKG_EXPORT
extern char *
pkg_plong(
char *buf,
unsigned long l);
Header file for the BRL-CAD common definitions.
int pkg_waitfor(int type, char *buf, size_t len, struct pkg_conn *pc)
int pkg_send(int type, const char *buf, size_t len, struct pkg_conn *pc)
struct pkg_conn * pkg_transerver(const struct pkg_switch *switchp, pkg_errlog errlog)
char * pkg_pshort(char *buf, unsigned short s)
int pkg_flush(struct pkg_conn *pc)
void(* pkg_errlog)(const char *msg)
unsigned long pkg_glong(char *buf)
int pkg_permserver(const char *service, const char *protocol, int backlog, pkg_errlog)
int pkg_stream(int type, const char *buf, size_t len, struct pkg_conn *pc)
int pkg_block(struct pkg_conn *pc)
void(* pkg_callback)(struct pkg_conn *, char *)
struct pkg_conn * pkg_open(const char *host, const char *service, const char *protocol, const char *username, const char *passwd, const struct pkg_switch *switchp, pkg_errlog errlog)
int pkg_2send(int type, const char *buf1, size_t len1, const char *buf2, size_t len2, struct pkg_conn *pc)
void pkg_close(struct pkg_conn *pc)
int pkg_permserver_ip(const char *ipOrHostname, const char *service, const char *protocol, int backlog, pkg_errlog errlog)
char * pkg_bwaitfor(int type, struct pkg_conn *pc)
int pkg_process(struct pkg_conn *)
int pkg_suckin(struct pkg_conn *)
struct pkg_conn * pkg_getclient(int fd, const struct pkg_switch *switchp, pkg_errlog errlog, int nodelay)
unsigned short pkg_gshort(char *buf)
char * pkg_plong(char *buf, unsigned long l)
const char * pkg_version(void)
int pkc_fd
TCP connection fd.
struct pkg_header pkc_hdr
hdr of cur msg
pkg_errlog pkc_errlog
Error message logger.
int pkc_incur
current pos in inbuf
int pkc_strpos
index into stream buffer
int pkc_inend
first unused pos in inbuf
int pkc_left
# bytes pkg_get expects
int pkc_in_fd
input connection fd
char * pkc_inbuf
input stream buffer
void * pkc_user_data
User defined pointer to data for the current pkg_type.
unsigned int pkc_magic
for validating pointers
int pkc_out_fd
output connection fd
size_t pkc_len
pkg_len, in host order
const struct pkg_switch * pkc_switch
Array of message handlers.
char * pkc_curpos
current position in pkg_buf
void * pkc_server_data
used to hold server data for callbacks
unsigned short pkc_type
pkg_type, in host order
char pkc_stream[PKG_STREAMLEN]
output stream
int pkc_inlen
length of pkc_inbuf
char * pkc_buf
start of dynamic buf
unsigned short pks_type
Type code.
void * pks_user_data
User defined pointer to data.
const char * pks_title
Description of message type.
pkg_callback pks_handler
Message Handler.