* Europagate, 1995
*
* $Log: zaccess.h,v $
- * Revision 1.11 1995/04/19 12:55:41 quinn
+ * Revision 1.12 1995/04/20 15:25:25 quinn
+ * Asynch. API
+ *
+ * Revision 1.11 1995/04/19 12:55:41 quinn
* Added auth
*
* Revision 1.10 1995/04/17 11:27:24 quinn
#define ZASS_NAME "EUROPAGATE E-mail/Z39.50 gateway"
#define ZASS_VERSION "development 0.2"
-#define ZASS_MAXRECORDSIZE 10000
-#define ZASS_PREFERREDMESSAGESIZE 10000
+#define ZASS_MAXRECORDSIZE 40000
+#define ZASS_PREFERREDMESSAGESIZE 40000
typedef struct zass *ZASS;
struct zass_record *records;
} zass_presentent;
-ZASS zass_open(char *host, int port, char *auth);
+/*
+ * open a connection to the target. If complete is NULL, the connection
+ * will be blocking, and complete will be ignored by the following
+ * primitives. If complete is not null, the connection will be non-blocking.
+ * if the connection cannot be established immediately, *complete will
+ * be set to zero, and the user should call openresult when select signals
+ * that I/O is possible. Returns NULL on a fatal error in the connection
+ * establishment.
+ */
+ZASS zass_open(char *host, int port, int *complete, char *auth);
+
+/*
+ * second half of connection establishment in nonblocking mode.
+ * Returns:
+ * -1 with *complete == 0 : call again when select allows.
+ * -1 with *complete == 1 : fatal error. Abort connection.
+ * 0 : success.
+ */
+int zass_openresult(ZASS a, int *complete);
+
+/*
+ * Return the file handle of the association (for select() & other fun.
+ */
+int zass_fileno(ZASS a);
+
+/*
+ * Returns:
+ * NULL with *complete == 0 : call searchresult when select allows (nonbl. only)
+ * NULL with *complete == 1 : fatal error. Abort connection.
+ * non-null : operation complete.
+ */
const struct zass_searchent *zass_search(ZASS a, struct ccl_rpn_node *query,
- char *resname, char *databases);
+ char *resname, char *databases, int *complete);
+
+/*
+ * Returns:
+ * NULL with *complete == 0 : call again when select allows (nonbl. only)
+ * NULL with *complete == 1 : fatal error. Abort connection.
+ * non-null : operation complete.
+ */
+const struct zass_searchent *zass_searchresult(ZASS a, int *complete);
+
+/*
+ * Returns:
+ * NULL with *complete == 0 : call presentresult when select ok (nonbl. only)
+ * NULL with *complete == 1 : fatal error. Abort connection.
+ * non-null : operation complete.
+ */
const struct zass_presentent *zass_present(ZASS a, char *resname, int start,
- int num);
+ int num, int *complete);
+
+/*
+ * Returns:
+ * NULL with *complete == 0 : call again when select allows (nonbl. only)
+ * NULL with *complete == 1 : fatal error. Abort connection.
+ * non-null : operation complete.
+ */
+const struct zass_presentent *zass_presentresult(ZASS a, int *complete);
#endif