diff -r 7198caede741 -r 439f186185be include/ectty.h --- a/include/ectty.h Mon Jan 25 16:15:56 2010 +0100 +++ b/include/ectty.h Mon Jan 25 17:42:07 2010 +0100 @@ -49,22 +49,27 @@ struct ec_tty; typedef struct ec_tty ec_tty_t; /**< \see ec_tty */ +/** + * \param cflag_changed This callback function is called when the serial + * settings shall be changed. The \a cflag argument contains the new settings. + */ +typedef struct { + int (*cflag_changed)(void *, tcflag_t); +} ec_tty_operations_t; + /****************************************************************************** * Global functions *****************************************************************************/ /** Create a virtual TTY interface. * - * \param cflag_cb This callback function is called when the serial settings - * shall be changed. The \a cb_data argument is the same as the \a cb_data - * given on device creation, while the \a cflag argument contains the new - * settings. - * \param cb_data Arbitrary data to pass to callbacks. + * \param ops Set of callbacks. + * \param cb_data Arbitrary data, that is passed to any callback. * * \return Pointer to the interface object, otherwise an ERR_PTR value. */ ec_tty_t *ectty_create( - int (*cflag_cb)(void *cb_data, tcflag_t cflag), + const ec_tty_operations_t *ops, void *cb_data );