summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f0c628b)
raw | patch | inline | side by side (parent: f0c628b)
author | pjrm <pjrm@users.sourceforge.net> | |
Sun, 4 May 2008 12:26:23 +0000 (12:26 +0000) | ||
committer | pjrm <pjrm@users.sourceforge.net> | |
Sun, 4 May 2008 12:26:23 +0000 (12:26 +0000) |
src/trace/potrace/greymap.cpp | patch | blob | history | |
src/trace/potrace/greymap.h | patch | blob | history |
index 53c703aa406a686e5f72acfec49e0e278ab1adc7..646ecc3a5323b07216d6055ffadbc6f4269d34c8 100644 (file)
/* ---------------------------------------------------------------------- */
-/* read a PNM stream: P1-P6 format (see pnm(5)), or a BMP stream, and
+char const *gm_read_error = NULL;
+
+/** Read a PNM stream: P1-P6 format (see pnm(5)), or a BMP stream, and
convert the output to a greymap. Return greymap in *gmp. Return 0
on success, -1 on error with errno set, -2 on bad file format (with
error message in gm_read_error), and 1 on premature end of file, -3
on empty file (including files with only whitespace and comments),
-4 if wrong magic number. If the return value is >=0, *gmp is
- valid. */
-
-char *gm_read_error = NULL;
-
+ valid.
+ */
int gm_read(FILE *f, greymap_t **gmp) {
int magic[2];
index 05e01667d7173589494e58bc3e227668b1c32ed4..059fec4e4b6102550601a5e343aef3bcf590cfc2 100644 (file)
#define GM_MODE_POSITIVE 3
#define GM_MODE_NEGATIVE 4
-extern char *gm_read_error;
+extern char const *gm_read_error;
greymap_t *gm_new(int w, int h);
greymap_t *gm_dup(greymap_t *gm);