diff options
author | Christian Hesse <mail@eworm.de> | 2014-02-25 12:12:30 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2014-02-25 12:12:30 +0100 |
commit | f5f01f3ff143edd87b7e36f1b3540cbc5d42c51f (patch) | |
tree | 5c2b6f5dbbb342ccc5ba770fd4bb4f73c151c246 /cqrlogo.h | |
parent | 0f32341ead4f1534270a82c4372d84a1aaa9b0cd (diff) | |
download | cqrlogo-f5f01f3ff143edd87b7e36f1b3540cbc5d42c51f.tar.gz cqrlogo-f5f01f3ff143edd87b7e36f1b3540cbc5d42c51f.tar.zst |
build a shared library and rework parts of the code
Diffstat (limited to 'cqrlogo.h')
-rw-r--r-- | cqrlogo.h | 45 |
1 files changed, 12 insertions, 33 deletions
@@ -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 <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <inttypes.h> +#include <regex.h> +#include <stdbool.h> #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 <fcgi_stdio.h> #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 <libcqrlogo.h> -/*** 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 */ |