/* -*-c-*-
*
- * $Id: txport.h,v 1.1 2002/01/25 19:34:45 mdw Exp $
+ * $Id: txport.h,v 1.2 2002/01/30 09:27:10 mdw Exp $
*
* Transport switch glue
*
/*----- Revision history --------------------------------------------------*
*
* $Log: txport.h,v $
+ * Revision 1.2 2002/01/30 09:27:10 mdw
+ * Transport configuration overhaul. Configuration string is now a list of
+ * `;'-separated `key=value' strings, which can be handled either by the
+ * core or the transport module. The newline character(s) are a core
+ * parameter now.
+ *
* Revision 1.1 2002/01/25 19:34:45 mdw
* Initial revision
*
const char *name;
const struct txfile *fv;
const char *config;
- txport *(*create)(const char */*file*/, const char */*config*/);
+ txport *(*create)(const char */*file*/);
+ int (*configure)(txport */*tx*/, const char */*k*/, const char */*v*/);
void *(*fetch)(void */*txv*/);
ssize_t (*write)(txport */*tx*/, const void */*p*/, size_t /*sz*/);
void (*destroy)(txport */*tx*/);
extern txport *tx_create(const char */*name*/, const char */*file*/,
const char */*config*/);
+/* --- @tx_configure@ --- *
+ *
+ * Arguments: @txport *tx@ = pointer to transport block
+ * @const char *config@ = config string
+ *
+ * Returns: Zero if OK, nonzero on errors.
+ *
+ * Use: Applies a configuration string to a transport.
+ */
+
+extern int tx_configure(txport */*tx*/, const char */*config*/);
+
/* --- @tx_write@ --- *
*
* Arguments: @txport *tx@ = pointer to transport context
extern int tx_printf(txport */*tx*/, const char */*p*/, ...);
+/* --- @tx_newline@ --- *
+ *
+ * Arguments: @txport *tx@ = pointer to transport context
+ *
+ * Returns: Zero if OK, nonzero on error.
+ *
+ * Use: Writes a newline (record boundary) to the output.
+ */
+
+int tx_newline(txport */*tx*/);
+
/* --- @tx_read@, @tx_readx@ --- *
*
* Arguments: @txport *tx@ = pointer to transport context