chiark / gitweb /
WIP island determination; pixmap handling in progress
[ypp-sc-tools.db-live.git] / pctb / common.h
index 8b66cf5e94b416a1a3ce4c1aba9bb1c9cbe135da..635a53a7ddd2a70dfa6fffafcd2ca75ada342106 100644 (file)
 #define _GNU_SOURCE
 
 #include <stdarg.h>
 #define _GNU_SOURCE
 
 #include <stdarg.h>
-
+#include <stdio.h>
+#include <errno.h>
+#include <assert.h>
+#include <string.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <inttypes.h>
+
+#include <sys/wait.h>
 #include <sys/types.h>
 
 typedef struct {
 #include <sys/types.h>
 
 typedef struct {
@@ -51,12 +60,16 @@ typedef struct { /* both inclusive */
   Point br;
 } Rect;
 
   Point br;
 } Rect;
 
+#define RECT_W(r) ((r).br.x - (r).tl.x + 1)
+#define RECT_H(r) ((r).br.y - (r).tl.y + 1)
+
 
 
 #define DEBUG_FLAG_LIST                                \
    DF(findypp)                                 \
    DF(pages)                                   \
    DF(rect)                                    \
 
 
 #define DEBUG_FLAG_LIST                                \
    DF(findypp)                                 \
    DF(pages)                                   \
    DF(rect)                                    \
+   DF(pixmap)                                  \
    DF(struct)                                  \
    DF(ocr)                                     \
    DF(callout)
    DF(struct)                                  \
    DF(ocr)                                     \
    DF(callout)
@@ -117,5 +130,7 @@ void waitpid_check_exitstatus(pid_t pid, const char *what);
 void *mmalloc(size_t sz);
 void *mrealloc(void *p, size_t sz);
 
 void *mmalloc(size_t sz);
 void *mrealloc(void *p, size_t sz);
 
+void fgetsline(FILE *f, char *lbuf, size_t lbufsz);
+
 
 #endif /*COMMON_H*/
 
 #endif /*COMMON_H*/