From: Adam Dickmeiss Date: Fri, 17 May 2002 12:48:29 +0000 (+0000) Subject: Use __stdcall convention for ZOOM on WIN32 X-Git-Tag: YAZ.1.8.7.test1~1 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=2af1d65a7126d623ab596d831d6bc4257d75a051;p=yaz-moved-to-github.git Use __stdcall convention for ZOOM on WIN32 --- diff --git a/include/yaz/zoom.h b/include/yaz/zoom.h index b3c81a4..50b448b 100644 --- a/include/yaz/zoom.h +++ b/include/yaz/zoom.h @@ -1,14 +1,19 @@ /* * Public header for ZOOM C. - * $Id: zoom.h,v 1.11 2002-01-28 09:27:48 adam Exp $ + * $Id: zoom.h,v 1.12 2002-05-17 12:48:29 adam Exp $ */ #include -#define ZOOM_EXPORT YAZ_EXPORT #define ZOOM_BEGIN_CDECL YAZ_BEGIN_CDECL #define ZOOM_END_CDECL YAZ_END_CDECL +#ifdef WIN32 +# define ZOOM_API(x) __declspec(dllexport) x __stdcall +#else +# define ZOOM_API(x) x +# endif + ZOOM_BEGIN_CDECL /* ----------------------------------------------------------- */ @@ -27,46 +32,46 @@ typedef struct ZOOM_scanset_p *ZOOM_scanset; /* create connection, connect to host, if portnum is 0, then port is read from host string (e.g. myhost:9821) */ -ZOOM_EXPORT -ZOOM_connection ZOOM_connection_new (const char *host, int portnum); +ZOOM_API(ZOOM_connection) +ZOOM_connection_new (const char *host, int portnum); /* create connection, don't connect, apply options */ -ZOOM_EXPORT -ZOOM_connection ZOOM_connection_create (ZOOM_options options); +ZOOM_API(ZOOM_connection) +ZOOM_connection_create (ZOOM_options options); /* connect given existing connection */ -ZOOM_EXPORT -void ZOOM_connection_connect(ZOOM_connection c, const char *host, +ZOOM_API(void) +ZOOM_connection_connect(ZOOM_connection c, const char *host, int portnum); /* destroy connection (close connection also) */ -ZOOM_EXPORT -void ZOOM_connection_destroy (ZOOM_connection c); +ZOOM_API(void) +ZOOM_connection_destroy (ZOOM_connection c); /* get/set option for connection */ -ZOOM_EXPORT -const char *ZOOM_connection_option_get (ZOOM_connection c, const char *key); +ZOOM_API(const char *) +ZOOM_connection_option_get (ZOOM_connection c, const char *key); -ZOOM_EXPORT -void ZOOM_connection_option_set (ZOOM_connection c, const char *key, - const char *val); +ZOOM_API(void) +ZOOM_connection_option_set (ZOOM_connection c, const char *key, + const char *val); /* return error code (0 == success, failure otherwise). cp holds error string on failure, addinfo holds addititional info (if any) */ -ZOOM_EXPORT -int ZOOM_connection_error (ZOOM_connection c, const char **cp, +ZOOM_API(int) +ZOOM_connection_error (ZOOM_connection c, const char **cp, const char **addinfo); /* returns error code */ -ZOOM_EXPORT -int ZOOM_connection_errcode (ZOOM_connection c); +ZOOM_API(int) +ZOOM_connection_errcode (ZOOM_connection c); /* returns error message */ -ZOOM_EXPORT -const char *ZOOM_connection_errmsg (ZOOM_connection c); +ZOOM_API(const char *) +ZOOM_connection_errmsg (ZOOM_connection c); /* returns additional info */ -ZOOM_EXPORT -const char *ZOOM_connection_addinfo (ZOOM_connection c); +ZOOM_API(const char *) +ZOOM_connection_addinfo (ZOOM_connection c); #define ZOOM_ERROR_NONE 0 #define ZOOM_ERROR_CONNECT 10000 @@ -78,8 +83,8 @@ const char *ZOOM_connection_addinfo (ZOOM_connection c); #define ZOOM_ERROR_INTERNAL 10006 #define ZOOM_ERROR_TIMEOUT 10007 -ZOOM_EXPORT -int ZOOM_connection_last_event(ZOOM_connection cs); +ZOOM_API(int) +ZOOM_connection_last_event(ZOOM_connection cs); #define ZOOM_EVENT_NONE 0 #define ZOOM_EVENT_CONNECT 1 @@ -94,125 +99,122 @@ int ZOOM_connection_last_event(ZOOM_connection cs); /* result sets */ /* create result set given a search */ -ZOOM_EXPORT -ZOOM_resultset ZOOM_connection_search(ZOOM_connection, ZOOM_query q); +ZOOM_API(ZOOM_resultset) +ZOOM_connection_search(ZOOM_connection, ZOOM_query q); /* create result set given PQF query */ -ZOOM_EXPORT -ZOOM_resultset ZOOM_connection_search_pqf(ZOOM_connection c, const char *q); +ZOOM_API(ZOOM_resultset) +ZOOM_connection_search_pqf(ZOOM_connection c, const char *q); /* destroy result set */ -ZOOM_EXPORT -void ZOOM_resultset_destroy(ZOOM_resultset r); +ZOOM_API(void) +ZOOM_resultset_destroy(ZOOM_resultset r); /* result set option */ -ZOOM_EXPORT -const char *ZOOM_resultset_option_get (ZOOM_resultset r, const char *key); -ZOOM_EXPORT -void ZOOM_resultset_option_set (ZOOM_resultset r, const char *key, const char *val); +ZOOM_API(const char *) +ZOOM_resultset_option_get (ZOOM_resultset r, const char *key); +ZOOM_API(void) +ZOOM_resultset_option_set (ZOOM_resultset r, const char *key, const char *val); /* return size of result set (alias hit count AKA result count) */ -ZOOM_EXPORT -size_t ZOOM_resultset_size (ZOOM_resultset r); +ZOOM_API(size_t) +ZOOM_resultset_size (ZOOM_resultset r); /* retrieve records */ -ZOOM_EXPORT -void ZOOM_resultset_records (ZOOM_resultset r, ZOOM_record *recs, - size_t start, size_t count); +ZOOM_API(void) +ZOOM_resultset_records (ZOOM_resultset r, ZOOM_record *recs, + size_t start, size_t count); /* return record object at pos. Returns 0 if unavailable */ -ZOOM_EXPORT -ZOOM_record ZOOM_resultset_record (ZOOM_resultset s, size_t pos); +ZOOM_API(ZOOM_record) +ZOOM_resultset_record (ZOOM_resultset s, size_t pos); /* like ZOOM_resultset_record - but never blocks .. */ -ZOOM_EXPORT -ZOOM_record ZOOM_resultset_record_immediate (ZOOM_resultset s, size_t pos); +ZOOM_API(ZOOM_record) +ZOOM_resultset_record_immediate (ZOOM_resultset s, size_t pos); /* ----------------------------------------------------------- */ /* records */ /* get record information, in a form given by type */ -ZOOM_EXPORT -const char *ZOOM_record_get (ZOOM_record rec, const char *type, int *len); +ZOOM_API(const char *) +ZOOM_record_get (ZOOM_record rec, const char *type, int *len); /* destroy record */ -ZOOM_EXPORT -void ZOOM_record_destroy (ZOOM_record rec); +ZOOM_API(void) +ZOOM_record_destroy (ZOOM_record rec); /* return copy of record */ -ZOOM_EXPORT -ZOOM_record ZOOM_record_clone (ZOOM_record srec); +ZOOM_API(ZOOM_record) +ZOOM_record_clone (ZOOM_record srec); /* ----------------------------------------------------------- */ /* queries */ /* create search object */ -ZOOM_EXPORT -ZOOM_query ZOOM_query_create(void); +ZOOM_API(ZOOM_query) +ZOOM_query_create(void); /* destroy it */ -ZOOM_EXPORT -void ZOOM_query_destroy(ZOOM_query s); +ZOOM_API(void) +ZOOM_query_destroy(ZOOM_query s); /* specify prefix query for search */ -ZOOM_EXPORT -int ZOOM_query_prefix(ZOOM_query s, const char *str); +ZOOM_API(int) +ZOOM_query_prefix(ZOOM_query s, const char *str); /* specify sort criteria for search */ -ZOOM_EXPORT -int ZOOM_query_sortby(ZOOM_query s, const char *criteria); +ZOOM_API(int) +ZOOM_query_sortby(ZOOM_query s, const char *criteria); /* ----------------------------------------------------------- */ /* scan */ -ZOOM_EXPORT -ZOOM_scanset ZOOM_connection_scan (ZOOM_connection c, const char *startterm); +ZOOM_API(ZOOM_scanset) +ZOOM_connection_scan (ZOOM_connection c, const char *startterm); -ZOOM_EXPORT -const char * ZOOM_scanset_term(ZOOM_scanset scan, size_t pos, - int *occ, int *len); +ZOOM_API(const char *) +ZOOM_scanset_term(ZOOM_scanset scan, size_t pos, + int *occ, int *len); -ZOOM_EXPORT -size_t ZOOM_scanset_size(ZOOM_scanset scan); +ZOOM_API(size_t) +ZOOM_scanset_size(ZOOM_scanset scan); -ZOOM_EXPORT -void ZOOM_scanset_destroy (ZOOM_scanset scan); +ZOOM_API(void) +ZOOM_scanset_destroy (ZOOM_scanset scan); -ZOOM_EXPORT -const char *ZOOM_scanset_option_get (ZOOM_scanset scan, const char *key); +ZOOM_API(const char *) +ZOOM_scanset_option_get (ZOOM_scanset scan, const char *key); -ZOOM_EXPORT -void ZOOM_scanset_option_set (ZOOM_scanset scan, const char *key, - const char *val); +ZOOM_API(void) +ZOOM_scanset_option_set (ZOOM_scanset scan, const char *key, + const char *val); /* ----------------------------------------------------------- */ /* options */ typedef const char *(*ZOOM_options_callback)(void *handle, const char *name); -ZOOM_EXPORT -ZOOM_options_callback ZOOM_options_set_callback (ZOOM_options opt, +ZOOM_API(ZOOM_options_callback) +ZOOM_options_set_callback (ZOOM_options opt, ZOOM_options_callback c, void *handle); -ZOOM_EXPORT -ZOOM_options ZOOM_options_create (void); - -ZOOM_EXPORT -ZOOM_options ZOOM_options_create_with_parent (ZOOM_options parent); +ZOOM_API(ZOOM_options) +ZOOM_options_create (void); -ZOOM_EXPORT -const char *ZOOM_options_get (ZOOM_options opt, const char *name); +ZOOM_API(ZOOM_options) +ZOOM_options_create_with_parent (ZOOM_options parent); -ZOOM_EXPORT -void ZOOM_options_set (ZOOM_options opt, const char *name, const char *v); +ZOOM_API(const char *) +ZOOM_options_get (ZOOM_options opt, const char *name); -ZOOM_EXPORT -void ZOOM_options_destroy (ZOOM_options opt); +ZOOM_API(void) +ZOOM_options_set (ZOOM_options opt, const char *name, const char *v); -ZOOM_EXPORT -int ZOOM_options_get_bool (ZOOM_options opt, const char *name, int defa); +ZOOM_API(void) +ZOOM_options_destroy (ZOOM_options opt); -ZOOM_EXPORT -int ZOOM_options_get_int (ZOOM_options opt, const char *name, int defa); +ZOOM_API(int) +ZOOM_options_get_bool (ZOOM_options opt, const char *name, int defa); -ZOOM_EXPORT -void ZOOM_options_set_int(ZOOM_options opt, const char *name, int value); +ZOOM_API(int) +ZOOM_options_get_int (ZOOM_options opt, const char *name, int defa); -ZOOM_EXPORT -void ZOOM_options_addref (ZOOM_options opt); +ZOOM_API(void) +ZOOM_options_set_int(ZOOM_options opt, const char *name, int value); /* ----------------------------------------------------------- */ /* events */ @@ -220,7 +222,7 @@ void ZOOM_options_addref (ZOOM_options opt); integer if event occurred ; zero if none occurred and no more events are pending. The positive integer specifies the connection for which the event occurred. */ -ZOOM_EXPORT -int ZOOM_event (int no, ZOOM_connection *cs); +ZOOM_API(int) +ZOOM_event (int no, ZOOM_connection *cs); ZOOM_END_CDECL diff --git a/server/statserv.c b/server/statserv.c index d126b98..7a02be7 100644 --- a/server/statserv.c +++ b/server/statserv.c @@ -6,7 +6,7 @@ * NT threaded server code by * Chas Woodfield, Fretwell Downing Informatics. * - * $Id: statserv.c,v 1.81 2002-05-07 11:01:59 adam Exp $ + * $Id: statserv.c,v 1.82 2002-05-17 12:48:29 adam Exp $ */ #include @@ -243,7 +243,7 @@ void statserv_closedown() } } -void event_loop_thread (IOCHAN iochan) +void __cdecl event_loop_thread (IOCHAN iochan) { event_loop (&iochan); } diff --git a/win/makefile b/win/makefile index 8f34919..6de6dca 100644 --- a/win/makefile +++ b/win/makefile @@ -1,5 +1,5 @@ # makefile.mak - makefile for MS NMAKE -# $Id: makefile,v 1.36 2002-03-18 21:33:48 adam Exp $ +# $Id: makefile,v 1.37 2002-05-17 12:48:30 adam Exp $ # # Programmed by # HL: Heikki Levanto, Index Data @@ -27,7 +27,7 @@ DEBUG=0 # 0 for release, 1 for debug default: all -all: dirs yaz_date_h generate dll client ztest zoomsh +all: dirs generate dll client ztest zoomsh NSIS="c:\program files\nsis\makensis.exe" @@ -83,7 +83,6 @@ IMPLIB=$(LIBDIR)\Yaz.lib CLIENT=$(BINDIR)\yaz-client.exe ZOOMSH=$(BINDIR)\zoomsh.exe ZTEST=$(BINDIR)\yaz-ztest.exe -YAZ_DATE_H=$(INCLDIR)\yaz\yaz-date.h ZOOMTST1=$(BINDIR)\zoomtst1.exe ZOOMTST2=$(BINDIR)\zoomtst2.exe @@ -102,8 +101,6 @@ ztest: $(ZTEST) zoomsh: $(ZOOMSH) $(ZOOMTST1) $(ZOOMTST2) $(ZOOMTST3) \ $(ZOOMTST4) $(ZOOMTST5) $(ZOOMTST6) $(ZOOMTST7) $(ZOOMTST8) -yaz_date_h: $(YAZ_DATE_H) - ########################################################### ############### Compiler and linker options ########################################################### @@ -551,11 +548,6 @@ generated_files: \ !if $(HAVE_TCL) -$(YAZ_DATE_H): - @cd .. - $(TCL) util\cvs-date.tcl include\yaz\yaz-date.h - @cd win - $(Z3950V3_FILES): $(Z3950DIR)\z3950v3.asn @cd $(Z3950DIR) $(TCL) $(TCLOPT) -d z.tcl z3950v3.asn @@ -842,7 +834,10 @@ $(ILL_OBJS): $(ILL_CORE_FILES) $(ITEM_REQ_FILES) ########################################################### # # $Log: makefile,v $ -# Revision 1.36 2002-03-18 21:33:48 adam +# Revision 1.37 2002-05-17 12:48:30 adam +# Use __stdcall convention for ZOOM on WIN32 +# +# Revision 1.36 2002/03/18 21:33:48 adam # MARC records embedded in C code for test server # # Revision 1.35 2002/03/16 10:26:57 adam diff --git a/zoom/zoom-c.c b/zoom/zoom-c.c index bb4e62e..61f29d6 100644 --- a/zoom/zoom-c.c +++ b/zoom/zoom-c.c @@ -1,5 +1,5 @@ /* - * $Id: zoom-c.c,v 1.27 2002-05-14 13:42:26 oleg Exp $ + * $Id: zoom-c.c,v 1.28 2002-05-17 12:48:30 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -136,7 +136,8 @@ static ZOOM_record record_cache_lookup (ZOOM_resultset r, int pos, const char *elementSetName); -ZOOM_connection ZOOM_connection_create (ZOOM_options options) +ZOOM_API(ZOOM_connection) +ZOOM_connection_create (ZOOM_options options) { ZOOM_connection c = (ZOOM_connection) xmalloc (sizeof(*c)); @@ -226,7 +227,8 @@ static char **set_DatabaseNames (ZOOM_connection con, ZOOM_options options, return databaseNames; } -ZOOM_connection ZOOM_connection_new (const char *host, int portnum) +ZOOM_API(ZOOM_connection) +ZOOM_connection_new (const char *host, int portnum) { ZOOM_connection c = ZOOM_connection_create (0); @@ -234,8 +236,9 @@ ZOOM_connection ZOOM_connection_new (const char *host, int portnum) return c; } -void ZOOM_connection_connect(ZOOM_connection c, - const char *host, int portnum) +ZOOM_API(void) +ZOOM_connection_connect(ZOOM_connection c, + const char *host, int portnum) { const char *val; ZOOM_task task; @@ -270,7 +273,8 @@ void ZOOM_connection_connect(ZOOM_connection c, } } -ZOOM_query ZOOM_query_create(void) +ZOOM_API(ZOOM_query) +ZOOM_query_create(void) { ZOOM_query s = (ZOOM_query) xmalloc (sizeof(*s)); @@ -282,7 +286,8 @@ ZOOM_query ZOOM_query_create(void) return s; } -void ZOOM_query_destroy(ZOOM_query s) +ZOOM_API(void) +ZOOM_query_destroy(ZOOM_query s) { if (!s) return; @@ -296,7 +301,8 @@ void ZOOM_query_destroy(ZOOM_query s) } } -int ZOOM_query_prefix(ZOOM_query s, const char *str) +ZOOM_API(int) +ZOOM_query_prefix(ZOOM_query s, const char *str) { s->query = (Z_Query *) odr_malloc (s->odr, sizeof(*s->query)); s->query->which = Z_Query_type_1; @@ -306,7 +312,8 @@ int ZOOM_query_prefix(ZOOM_query s, const char *str) return 0; } -int ZOOM_query_sortby(ZOOM_query s, const char *criteria) +ZOOM_API(int) +ZOOM_query_sortby(ZOOM_query s, const char *criteria) { s->sort_spec = yaz_sort_spec (s->odr, criteria); if (!s->sort_spec) @@ -316,7 +323,8 @@ int ZOOM_query_sortby(ZOOM_query s, const char *criteria) static int do_write(ZOOM_connection c); -void ZOOM_connection_destroy(ZOOM_connection c) +ZOOM_API(void) +ZOOM_connection_destroy(ZOOM_connection c) { ZOOM_resultset r; if (!c) @@ -364,7 +372,8 @@ ZOOM_resultset ZOOM_resultset_create () return r; } -ZOOM_resultset ZOOM_connection_search_pqf(ZOOM_connection c, const char *q) +ZOOM_API(ZOOM_resultset) +ZOOM_connection_search_pqf(ZOOM_connection c, const char *q) { ZOOM_resultset r; ZOOM_query s = ZOOM_query_create(); @@ -376,7 +385,8 @@ ZOOM_resultset ZOOM_connection_search_pqf(ZOOM_connection c, const char *q) return r; } -ZOOM_resultset ZOOM_connection_search(ZOOM_connection c, ZOOM_query q) +ZOOM_API(ZOOM_resultset) +ZOOM_connection_search(ZOOM_connection c, ZOOM_query q) { ZOOM_resultset r = ZOOM_resultset_create (); ZOOM_task task; @@ -414,7 +424,8 @@ ZOOM_resultset ZOOM_connection_search(ZOOM_connection c, ZOOM_query q) return r; } -void ZOOM_resultset_destroy(ZOOM_resultset r) +ZOOM_API(void) +ZOOM_resultset_destroy(ZOOM_resultset r) { if (!r) return; @@ -450,7 +461,8 @@ void ZOOM_resultset_destroy(ZOOM_resultset r) } } -size_t ZOOM_resultset_size (ZOOM_resultset r) +ZOOM_API(size_t) +ZOOM_resultset_size (ZOOM_resultset r) { return r->size; } @@ -487,8 +499,9 @@ static void ZOOM_resultset_retrieve (ZOOM_resultset r, ; } -void ZOOM_resultset_records (ZOOM_resultset r, ZOOM_record *recs, - size_t start, size_t count) +ZOOM_API(void) +ZOOM_resultset_records (ZOOM_resultset r, ZOOM_record *recs, + size_t start, size_t count) { int force_present = 0; @@ -849,7 +862,8 @@ static void response_diag (ZOOM_connection c, Z_DiagRec *p) c->error = *r->condition; } -ZOOM_record ZOOM_record_clone (ZOOM_record srec) +ZOOM_API(ZOOM_record) +ZOOM_record_clone (ZOOM_record srec) { char *buf; int size; @@ -871,18 +885,21 @@ ZOOM_record ZOOM_record_clone (ZOOM_record srec) return nrec; } -ZOOM_record ZOOM_resultset_record_immediate (ZOOM_resultset s,size_t pos) +ZOOM_API(ZOOM_record) +ZOOM_resultset_record_immediate (ZOOM_resultset s,size_t pos) { return record_cache_lookup (s, pos, 0); } -ZOOM_record ZOOM_resultset_record (ZOOM_resultset r, size_t pos) +ZOOM_API(ZOOM_record) +ZOOM_resultset_record (ZOOM_resultset r, size_t pos) { ZOOM_resultset_retrieve (r, 1, pos, 1); return ZOOM_resultset_record_immediate (r, pos); } -void ZOOM_record_destroy (ZOOM_record rec) +ZOOM_API(void) +ZOOM_record_destroy (ZOOM_record rec) { if (!rec) return; @@ -892,7 +909,8 @@ void ZOOM_record_destroy (ZOOM_record rec) xfree (rec); } -const char *ZOOM_record_get (ZOOM_record rec, const char *type, int *len) +ZOOM_API(const char *) +ZOOM_record_get (ZOOM_record rec, const char *type, int *len) { Z_NamePlusRecord *npr; @@ -1366,7 +1384,8 @@ static int send_present (ZOOM_connection c) return 1; } -ZOOM_scanset ZOOM_connection_scan (ZOOM_connection c, const char *start) +ZOOM_API(ZOOM_scanset) +ZOOM_connection_scan (ZOOM_connection c, const char *start) { ZOOM_scanset scan = (ZOOM_scanset) xmalloc (sizeof(*scan)); @@ -1393,7 +1412,8 @@ ZOOM_scanset ZOOM_connection_scan (ZOOM_connection c, const char *start) return scan; } -void ZOOM_scanset_destroy (ZOOM_scanset scan) +ZOOM_API(void) +ZOOM_scanset_destroy (ZOOM_scanset scan) { if (!scan) return; @@ -1407,7 +1427,7 @@ void ZOOM_scanset_destroy (ZOOM_scanset scan) } } -int send_scan (ZOOM_connection c) +static int send_scan (ZOOM_connection c) { ZOOM_scanset scan; Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_scanRequest); @@ -1439,14 +1459,16 @@ int send_scan (ZOOM_connection c) return 1; } -size_t ZOOM_scanset_size (ZOOM_scanset scan) +ZOOM_API(size_t) +ZOOM_scanset_size (ZOOM_scanset scan) { if (!scan || !scan->scan_response || !scan->scan_response->entries) return 0; return scan->scan_response->entries->num_entries; } -const char *ZOOM_scanset_term (ZOOM_scanset scan, size_t pos, +ZOOM_API(const char *) +ZOOM_scanset_term (ZOOM_scanset scan, size_t pos, int *occ, int *len) { const char *term = 0; @@ -1471,12 +1493,14 @@ const char *ZOOM_scanset_term (ZOOM_scanset scan, size_t pos, return term; } -const char *ZOOM_scanset_option_get (ZOOM_scanset scan, const char *key) +ZOOM_API(const char *) +ZOOM_scanset_option_get (ZOOM_scanset scan, const char *key) { return ZOOM_options_get (scan->options, key); } -void ZOOM_scanset_option_set (ZOOM_scanset scan, const char *key, +ZOOM_API(void) +ZOOM_scanset_option_set (ZOOM_scanset scan, const char *key, const char *val) { ZOOM_options_set (scan->options, key, val); @@ -1662,49 +1686,57 @@ static int do_write(ZOOM_connection c) } -const char *ZOOM_connection_option_get (ZOOM_connection c, const char *key) +ZOOM_API(const char *) +ZOOM_connection_option_get (ZOOM_connection c, const char *key) { return ZOOM_options_get (c->options, key); } -void ZOOM_connection_option_set (ZOOM_connection c, const char *key, +ZOOM_API(void) +ZOOM_connection_option_set (ZOOM_connection c, const char *key, const char *val) { ZOOM_options_set (c->options, key, val); } -const char *ZOOM_resultset_option_get (ZOOM_resultset r, const char *key) +ZOOM_API(const char *) +ZOOM_resultset_option_get (ZOOM_resultset r, const char *key) { return ZOOM_options_get (r->options, key); } -void ZOOM_resultset_option_set (ZOOM_resultset r, const char *key, +ZOOM_API(void) +ZOOM_resultset_option_set (ZOOM_resultset r, const char *key, const char *val) { ZOOM_options_set (r->options, key, val); } -int ZOOM_connection_errcode (ZOOM_connection c) +ZOOM_API(int) +ZOOM_connection_errcode (ZOOM_connection c) { return ZOOM_connection_error (c, 0, 0); } -const char *ZOOM_connection_errmsg (ZOOM_connection c) +ZOOM_API(const char *) +ZOOM_connection_errmsg (ZOOM_connection c) { const char *msg; ZOOM_connection_error (c, &msg, 0); return msg; } -const char *ZOOM_connection_addinfo (ZOOM_connection c) +ZOOM_API(const char *) +ZOOM_connection_addinfo (ZOOM_connection c) { const char *addinfo; ZOOM_connection_error (c, 0, &addinfo); return addinfo; } -int ZOOM_connection_error (ZOOM_connection c, const char **cp, +ZOOM_API(int) +ZOOM_connection_error (ZOOM_connection c, const char **cp, const char **addinfo) { int error = c->error; @@ -1744,7 +1776,7 @@ int ZOOM_connection_error (ZOOM_connection c, const char **cp, return c->error; } -int ZOOM_connection_do_io(ZOOM_connection c, int mask) +static int ZOOM_connection_do_io(ZOOM_connection c, int mask) { ZOOM_Event event = 0; int r = cs_look(c->cs); @@ -1797,14 +1829,16 @@ int ZOOM_connection_do_io(ZOOM_connection c, int mask) return 1; } -int ZOOM_connection_last_event(ZOOM_connection cs) +ZOOM_API(int) +ZOOM_connection_last_event(ZOOM_connection cs) { if (!cs) return ZOOM_EVENT_NONE; return cs->last_event; } -int ZOOM_event (int no, ZOOM_connection *cs) +ZOOM_API(int) +ZOOM_event (int no, ZOOM_connection *cs) { #if HAVE_SYS_POLL_H struct pollfd pollfds[1024]; diff --git a/zoom/zoom-opt.c b/zoom/zoom-opt.c index b74698c..883a5a3 100644 --- a/zoom/zoom-opt.c +++ b/zoom/zoom-opt.c @@ -1,5 +1,5 @@ /* - * $Id: zoom-opt.c,v 1.4 2002-01-28 09:27:48 adam Exp $ + * $Id: zoom-opt.c,v 1.5 2002-05-17 12:48:30 adam Exp $ * * ZOOM layer for C, options handling */ @@ -9,12 +9,14 @@ #include "zoom-p.h" -ZOOM_options ZOOM_options_create (void) +ZOOM_API(ZOOM_options) +ZOOM_options_create (void) { return ZOOM_options_create_with_parent (0); } -ZOOM_options ZOOM_options_create_with_parent (ZOOM_options parent) +ZOOM_API(ZOOM_options) +ZOOM_options_create_with_parent (ZOOM_options parent) { ZOOM_options opt = (ZOOM_options) xmalloc (sizeof(*opt)); @@ -33,7 +35,8 @@ void ZOOM_options_addref (ZOOM_options opt) (opt->refcount)++; } -ZOOM_options_callback ZOOM_options_set_callback ( +ZOOM_API(ZOOM_options_callback) +ZOOM_options_set_callback ( ZOOM_options opt, ZOOM_options_callback callback_func, void *callback_handle) @@ -47,7 +50,8 @@ ZOOM_options_callback ZOOM_options_set_callback ( return callback_old; } -void ZOOM_options_destroy (ZOOM_options opt) +ZOOM_API(void) +ZOOM_options_destroy (ZOOM_options opt) { if (!opt) return; @@ -70,7 +74,8 @@ void ZOOM_options_destroy (ZOOM_options opt) } } -void ZOOM_options_set (ZOOM_options opt, const char *name, const char *value) +ZOOM_API(void) +ZOOM_options_set (ZOOM_options opt, const char *name, const char *value) { struct ZOOM_options_entry **e; @@ -91,7 +96,8 @@ void ZOOM_options_set (ZOOM_options opt, const char *name, const char *value) (*e)->next = 0; } -const char *ZOOM_options_get (ZOOM_options opt, const char *name) +ZOOM_API(const char *) +ZOOM_options_get (ZOOM_options opt, const char *name) { const char *v = 0; if (!opt) @@ -113,7 +119,8 @@ const char *ZOOM_options_get (ZOOM_options opt, const char *name) return v; } -int ZOOM_options_get_bool (ZOOM_options opt, const char *name, int defa) +ZOOM_API(int) +ZOOM_options_get_bool (ZOOM_options opt, const char *name, int defa) { const char *v = ZOOM_options_get (opt, name); @@ -124,7 +131,8 @@ int ZOOM_options_get_bool (ZOOM_options opt, const char *name, int defa) return 0; } -int ZOOM_options_get_int (ZOOM_options opt, const char *name, int defa) +ZOOM_API(int) +ZOOM_options_get_int (ZOOM_options opt, const char *name, int defa) { const char *v = ZOOM_options_get (opt, name); @@ -133,7 +141,8 @@ int ZOOM_options_get_int (ZOOM_options opt, const char *name, int defa) return atoi(v); } -void ZOOM_options_set_int(ZOOM_options opt, const char *name, int value) +ZOOM_API(void) +ZOOM_options_set_int(ZOOM_options opt, const char *name, int value) { char s[40]; diff --git a/zoom/zoom-p.h b/zoom/zoom-p.h index 87f517e..80fa968 100644 --- a/zoom/zoom-p.h +++ b/zoom/zoom-p.h @@ -1,6 +1,6 @@ /* * Private C header for ZOOM C. - * $Id: zoom-p.h,v 1.8 2001-12-30 22:21:11 adam Exp $ + * $Id: zoom-p.h,v 1.9 2002-05-17 12:48:30 adam Exp $ */ #include #include @@ -137,4 +137,4 @@ struct ZOOM_Event_p { ZOOM_Event prev; }; - +void ZOOM_options_addref (ZOOM_options opt);