head 1.11; access; symbols SIO_0_9_3:1.11 SIO_0_9_2:1.10 SIO_0_9_1:1.10 SIO_0_9_0:1.10; locks; strict; comment @ * @; 1.11 date 2005.10.03.09.06.11; author rse; state Exp; branches; next 1.10; 1.10 date 2003.01.06.19.04.56; author rse; state Exp; branches; next 1.9; 1.9 date 2002.11.29.13.03.40; author mlelstv; state Exp; branches; next 1.8; 1.8 date 2002.11.28.16.29.37; author mlelstv; state Exp; branches; next 1.7; 1.7 date 2002.11.24.19.36.48; author mlelstv; state Exp; branches; next 1.6; 1.6 date 2002.11.14.15.56.10; author mlelstv; state Exp; branches; next 1.5; 1.5 date 2002.11.14.09.10.53; author rse; state Exp; branches; next 1.4; 1.4 date 2002.11.08.10.34.24; author mlelstv; state Exp; branches; next 1.3; 1.3 date 2002.11.07.15.29.53; author mlelstv; state Exp; branches; next 1.2; 1.2 date 2002.10.23.17.05.10; author mlelstv; state Exp; branches; next 1.1; 1.1 date 2002.10.22.12.57.20; author mlelstv; state Exp; branches; next ; desc @@ 1.11 log @adjust copyright messages @ text @/* ** OSSP sio - Stream I/O ** Copyright (c) 2002-2005 Cable & Wireless ** Copyright (c) 2002-2005 The OSSP Project ** Copyright (c) 2002-2005 Ralf S. Engelschall ** ** This file is part of OSSP sio, a layered stream I/O library ** which can be found at http://www.ossp.org/pkg/lib/sio/. ** ** Permission to use, copy, modify, and distribute this software for ** any purpose with or without fee is hereby granted, provided that ** the above copyright notice and this permission notice appear in all ** copies. ** ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ** SUCH DAMAGE. ** ** sio.h: stream I/O public API definition */ #ifndef __SIO_H__ #define __SIO_H__ typedef enum { SIO_OK, SIO_TRUE = SIO_OK, SIO_FALSE, SIO_ERR_ARG, SIO_ERR_MEM, SIO_ERR_EOF, SIO_ERR_SYS, SIO_ERR_INT, SIO_SCHED_UP, SIO_SCHED_DOWN, SIO_SCHED_CROSS, SIO_SCHED_LOOP } sio_rc_t; typedef enum { SIO_MODE_INVALID, SIO_MODE_READ, SIO_MODE_WRITE, SIO_MODE_READWRITE } sio_mode_t; typedef enum { SIO_FLAG_ERROR, SIO_FLAG_EOF } sio_flag_t; struct sio_st; typedef struct sio_st sio_t; struct sio_stage_st; typedef struct sio_stage_st sio_stage_t; struct sio_module_st; typedef struct sio_module_st sio_module_t; sio_rc_t sio_create (sio_t **siop); sio_rc_t sio_destroy (sio_t *sio); sio_rc_t sio_create_stage (sio_t *sio, sio_module_t *siom, sio_stage_t **siosp); sio_rc_t sio_destroy_stage (sio_t *sio, sio_stage_t *sios); sio_rc_t sio_configure_stage(sio_t *sio, sio_stage_t *sios, void *o, void *v); sio_rc_t sio_attach (sio_t *sio, sio_stage_t *sios, sio_mode_t rw); sio_rc_t sio_detach (sio_t *sio, sio_stage_t *sios); sio_rc_t sio_input (sio_t *sio, al_t *al, size_t limit, al_label_t label); sio_rc_t sio_output (sio_t *sio, al_t *al); sio_rc_t sio_read (sio_t *sio, char *dst, size_t n, size_t *actualp); sio_rc_t sio_write (sio_t *sio, char *src, size_t n, size_t *actualp); sio_rc_t sio_push (sio_t *sio); sio_rc_t sio_flag (sio_t *sio, sio_flag_t fl); sio_rc_t sio_clearflag (sio_t *sio, sio_flag_t fl); const char *sio_error (sio_rc_t rc); /* * data internal to modules that should not be exposed to * applications */ struct sio_module_st { const char *name; sio_rc_t (*init) (sio_t *, void **); sio_rc_t (*configure) (sio_t *, void *, void *, void *); sio_rc_t (*cleanup) (sio_t *, void *); sio_rc_t (*openr) (sio_t *, al_t *, void *); sio_rc_t (*closer) (sio_t *, al_t *, void *); sio_rc_t (*openw) (sio_t *, al_t *, void *); sio_rc_t (*closew) (sio_t *, al_t *, void *); sio_rc_t (*input) (sio_t *, al_t *, void *, sio_rc_t orc); sio_rc_t (*output) (sio_t *, al_t *, void *, sio_rc_t orc); sio_rc_t (*shutdown) (sio_t *, void *); }; typedef enum { SIO_LN_DATA, SIO_LN_ERROR, SIO_LN_EOF } sio_labelnum_t; sio_rc_t sio_label(sio_t *, sio_labelnum_t, al_label_t *); #endif /* __SIO_H__ */ @ 1.10 log @- consistently use standard OSSP copyright message everywhere - strip trailing whitespaces @ text @d3 3 a5 3 ** Copyright (c) 2002-2003 Cable & Wireless Deutschland ** Copyright (c) 2002-2003 The OSSP Project ** Copyright (c) 2002-2003 Ralf S. Engelschall @ 1.9 log @fix cut&paste error PR: Submitted by: Reviewed by: Approved by: Obtained from: @ text @d2 4 a5 5 ** OSSP sio -- Stream I/O ** Copyright (c) 2002 The OSSP Project ** Copyright (c) 2002 Cable & Wireless Deutschland ** Copyright (c) 2002 Ralf S. Engelschall ** Copyright (c) 2002 Michael van Elst d7 2 a8 1 ** This file is part of OSSP sio, a library implementing layered I/O @ 1.8 log @changed sio_input API to support label filtering PR: Submitted by: Reviewed by: Approved by: Obtained from: @ text @d107 2 a108 2 sio_rc_t (*input) (sio_t *, al_t *, void *); sio_rc_t (*output) (sio_t *, al_t *, void *); @ 1.7 log @add optional shutdown function to modules. On detach, it is called and if returning SIO_OK another round through output and input is done. modules are now pushed at pipe head instead of appended so that a module can do upstream I/O while being wound up. PR: Submitted by: Reviewed by: Approved by: Obtained from: @ text @d80 1 a80 1 sio_rc_t sio_input (sio_t *sio, al_t *al, size_t limit); @ 1.6 log @merged sio_module.h into sio.h renamed scheduler codes to SIO_SCHED_* added comments to sio.c PR: Submitted by: Reviewed by: Approved by: Obtained from: @ text @d109 1 @ 1.5 log @use the usual all-in-one-row formatting for APIs in OSSP headers to more easily see the common and different arguments @ text @d36 2 d43 4 a46 4 SIO_UPSTREAM, SIO_DOWNSTREAM, SIO_XSTREAM, SIO_LOOP d88 2 a89 2 int sio_flag (sio_t *sio, sio_flag_t fl); int sio_clearflag (sio_t *sio, sio_flag_t fl); d92 26 @ 1.4 log @add SIO_LOOP status to simplify protocol state machine PR: Submitted by: Reviewed by: Approved by: Obtained from: @ text @d68 2 a69 2 sio_rc_t sio_create(sio_t **siop); sio_rc_t sio_destroy(sio_t *sio); d71 3 a73 3 sio_rc_t sio_create_stage(sio_t *sio, sio_module_t *siom, sio_stage_t **siosp); sio_rc_t sio_destroy_stage(sio_t *sio, sio_stage_t *sios); sio_rc_t sio_configure_stage(sio_t *sio, sio_stage_t *sios, void *o, void *v); d75 2 a76 2 sio_rc_t sio_attach(sio_t *sio, sio_stage_t *sios, sio_mode_t rw); sio_rc_t sio_detach(sio_t *sio, sio_stage_t *sios); d78 2 a79 2 sio_rc_t sio_input(sio_t *sio, al_t *al, size_t limit); sio_rc_t sio_output(sio_t *sio, al_t *al); d81 2 a82 2 sio_rc_t sio_read(sio_t *sio, char *dst, size_t n, size_t *actualp); sio_rc_t sio_write(sio_t *sio, char *src, size_t n, size_t *actualp); d84 1 a84 1 sio_rc_t sio_push(sio_t *sio); d86 2 a87 2 int sio_flag(sio_t *sio, sio_flag_t fl); int sio_clearflag(sio_t *sio, sio_flag_t fl); d89 1 a89 1 const char *sio_error(sio_rc_t rc); @ 1.3 log @flag operations beautify prototype PR: Submitted by: Reviewed by: Approved by: Obtained from: @ text @d43 2 a44 1 SIO_XSTREAM @ 1.2 log @snapshot PR: Submitted by: Reviewed by: Approved by: Obtained from: @ text @d53 5 d70 1 a70 1 sio_rc_t sio_create_stage(sio_t *sio, sio_module_t *sioh, sio_stage_t **siosp); d84 3 @ 1.1 log @initial commit PR: Submitted by: Reviewed by: Approved by: Obtained from: @ text @d31 3 d42 2 a43 1 SIO_DOWNSTREAM d78 2 d81 2 @