#ifndef __UFO_ROOF_READ_H #define __UFO_ROOF_READ_H typedef struct _UfoRoofRead UfoRoofRead; #include "ufo-roof-config.h" #include "ufo-roof-buffer.h" //#include "ufo-roof-read-thread.h" G_BEGIN_DECLS typedef struct _UfoRoofReadInterface UfoRoofReadInterface; typedef struct _UfoRoofReadInterfaceSettings UfoRoofReadInterfaceSettings; //typedef guint (*UfoRoofReaderRead)(UfoRoofReadInterface *reader, uint8_t *buf, GError **error); typedef guint (*UfoRoofReaderRead)(UfoRoofReadInterface *reader, uint8_t **buf, GError **error); typedef void (*UfoRoofReaderClose)(UfoRoofReadInterface *reader); struct _UfoRoofReadInterfaceSettings { guint padding; // Packet size + padding }; struct _UfoRoofReadInterface { UfoRoofReaderRead read; UfoRoofReaderClose close; UfoRoofReadInterfaceSettings settings; }; typedef enum { UFO_ROOF_OP_STOP = 0, UFO_ROOF_OP_READ } UfoRoofOp; struct _UfoRoofReadContext { UfoRoofConfig *cfg; UfoRoofBuffer *buf; UfoRoofReadInterface *rdi; gulong packet // UfoRoofReadThread *thr; guint n_threads; UfoRoofOp op; // Current operation (reading by default) }; /* UfoRoofRead *ufo_roof_read_new(UfoRoofConfig *cfg, UfoRoofReadInterface *rdi, UfoRoofBuffer *buf, GError **error); void ufo_roof_read_free(UfoRoofRead *ctx); gboolean ufo_roof_read_start(UFORoofRead *ctx, GError **error); gboolean ufo_roof_read_stop(UFORoofRead *ctx, GError **error); const UfoRoofReadInterfaceSettings *ufo_roof_read_get_settings(UFORoofRead *ctx, GError **error); */ G_END_DECLS #endif /* __UFO_ROOF_READ_H */