X-Git-Url: https://git.distorted.org.uk/~mdw/jog/blobdiff_plain/2ec1e6937048636ec6761c3a76c5bf9544278601..efb4b3d6a7f9b4e99b0926fd512f709a139319b8:/txport.h diff --git a/txport.h b/txport.h index ad4f338..7a2e62b 100644 --- a/txport.h +++ b/txport.h @@ -1,6 +1,6 @@ /* -*-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 * @@ -29,6 +29,12 @@ /*----- 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 * @@ -107,7 +113,8 @@ typedef struct txport_ops { 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*/); @@ -138,6 +145,18 @@ extern const char *txconf; 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 @@ -165,6 +184,17 @@ extern int tx_vprintf(txport */*tx*/, const char */*p*/, va_list */*ap*/); 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