/** * \file * header file of protoInterface_test */ #ifndef PROTOINTERFACE_TEST_H #define PROTOINTERFACE_TEST_H #include #include #include "generic.h" /*====================================================== ======== TYPES ========================================= ======================================================*/ /** \defgroup protoInterface_test ProtoInterface for test executable */ /** \{ */ #define PROTOINTERFACE_BUFFER_INIT_SIZE 300 typedef struct ProtoInterface { FILE *outStream; } ProtoInterface; /** \} */ /*====================================================== ======== PROTOTYPES ==================================== ======================================================*/ /** \addtogroup protoInterface_test */ /** \{ */ int protoInterface_init(ProtoInterface *protoInterfacep, FILE *outStream); void protoInterface_destroy(ProtoInterface *protoInterfacep); /** Prints mesage to PROTO. \returns number of written characters if successfully or 0 if failed. */ int protoInterface_printf(ProtoInterface *protoInterfacep, const char *formatString, ...); INLINE int protoInterface_prints(ProtoInterface *protoInterfacep, const char *outputStringp) { fputs(outputStringp, protoInterfacep->outStream); return strlen(outputStringp); } INLINE void protoInterface_flush(ProtoInterface *protoInterfacep) { fputc('\n', protoInterfacep->outStream); } INLINE void* protoInterface_alloc(ProtoInterface *protoInterfacep, size_t size) { return malloc(size); } INLINE void protoInterface_free(ProtoInterface *protoInterfacep, void *p) { free(p); } /** \} */ #endif