#ifndef __SPROG_H__ #define __SPROG_H__ #include #define array_size(x) (sizeof(x)/sizeof(*x)) struct sprog_family { void *(*setup)(struct serial_device *dev); void (*init)(void *arg); void (*close)(void *arg); }; extern const char sprog_version[]; void sprog_communicate(const struct sprog_family *fam, const char *port, int baud); void sprog_process(const struct sprog_family *fam, void *arg, int nstdin, int nstdout); int sprog_getline(char *buf, int len, int timeout); void sprog_error(const char *text, ...); void sprog_sleep(int msec); #endif