From f5f01f3ff143edd87b7e36f1b3540cbc5d42c51f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 25 Feb 2014 12:12:30 +0100 Subject: build a shared library and rework parts of the code --- cqrlogo.h | 45 ++++++++++++--------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) (limited to 'cqrlogo.h') diff --git a/cqrlogo.h b/cqrlogo.h index d14050d..00795b9 100644 --- a/cqrlogo.h +++ b/cqrlogo.h @@ -8,45 +8,24 @@ #ifndef _CQRLOGO_H #define _CQRLOGO_H -/* a bitmap */ -struct bitmap_t { - unsigned int width; - unsigned int height; - uint8_t *pixel; -}; - -#if defined PNG_TEXT_SUPPORTED && PNG_ENABLE_TEXT -/*** add_png_text ***/ -png_text * add_png_text(png_text *pngtext, unsigned int *textcount, char *key, char *text); -#endif +#include +#include +#include +#include +#include +#include #if HAVE_FCGI -/*** png_write_stdout ***/ -void png_write_stdout(png_structp png_ptr, png_bytep data, png_size_t length); - -/*** png_flush_stdout ***/ -void png_flush_stdout(png_structp png_ptr); +#include #endif -/*** generate_png ***/ -int generate_png (struct bitmap_t *bitmap, const char *uri); - -/*** bitmap_new ***/ -struct bitmap_t * bitmap_new(int width, int height); -/*** bitmap_free ***/ -void bitmap_free(struct bitmap_t * bitmap); - -/*** encode_qrcode ***/ -struct bitmap_t * encode_qrcode (const char *text, unsigned int scale, - unsigned int border, unsigned int level); +#include -/*** get_query_value ***/ -unsigned int get_query_value(const char *query_string, const char *pattern, - unsigned int value, unsigned int min, unsigned int max); +#define URLPATTERN "^[hH][tT][tT][pP][sS]\\?://%s/" +#define TEXTSTOLEN "This QR Code has been stolen from http%s://%s/!" -/*** get_ini_value ***/ -unsigned int get_ini_value(dictionary * ini, uint8_t type, const char * section, const char * parameter, - unsigned int value, unsigned int min, unsigned int max); +/*** main ***/ +int main(int argc, char **argv); #endif /* _CQRLOGO_H */ -- cgit v1.2.3-54-g00ecf