From 0cf61f4ad847e94b6db56fca1a1b81f7368295a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=91=D0=BE=D1=80=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Mon, 4 Sep 2023 10:07:17 +0200 Subject: [PATCH] at work --- .gitignore | 5 ++ Makefile | 44 ++++++------- clib/Makefile.am | 2 +- clib/Makefile.in | 2 +- clib/jblock.c | 148 +++++++++++++++++++++++++++++++++++++++++++- clib/jblock.h | 84 ++++++++++++++++++++----- clib/jblock_test.c | 49 ++++++++++++--- clib/jlexer.c | 54 ++++++++++------ clib/jlexer.h | 22 ++++--- clib/jlexer_test.c | 4 +- clib/jparser.c | 3 +- clib/jparser.h | 7 ++- clib/jparser_test.c | 4 +- config.h | 6 +- config.status | 50 +++++++-------- defines.h | 12 ++-- 16 files changed, 372 insertions(+), 124 deletions(-) diff --git a/.gitignore b/.gitignore index 872d7f2..ec47a7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ cworker configure +libtool Makefile +config.h *~ *_test *.o @@ -10,3 +12,6 @@ Makefile *.tar.* stamp* autom4te* +*.lo +*.la +.libs diff --git a/Makefile b/Makefile index e63451a..68c90ed 100644 --- a/Makefile +++ b/Makefile @@ -237,20 +237,20 @@ distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /home/ziggi/projects/cworker/missing aclocal +ACLOCAL = ${SHELL} /home/ziggi/Projects/cworker/missing aclocal AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 1 -APP_CACHEDIR = /home/ziggi/projects/cworker/cache -APP_CONFIGDIR = /home/ziggi/projects/cworker/ -APP_DATABASEDIR = /home/ziggi/projects/cworker/data -APP_LIBDIR = /home/ziggi/projects/cworker/lib -APP_LOGDIR = /home/ziggi/projects/cworker/log -APP_RUNDIR = /home/ziggi/projects/cworker/run +APP_CACHEDIR = /home/ziggi/Projects/cworker/cache +APP_CONFIGDIR = /home/ziggi/Projects/cworker/ +APP_DATABASEDIR = /home/ziggi/Projects/cworker/data +APP_LIBDIR = /home/ziggi/Projects/cworker/lib +APP_LOGDIR = /home/ziggi/Projects/cworker/log +APP_RUNDIR = /home/ziggi/Projects/cworker/run APP_USER = ziggi AR = ar -AUTOCONF = ${SHELL} /home/ziggi/projects/cworker/missing autoconf -AUTOHEADER = ${SHELL} /home/ziggi/projects/cworker/missing autoheader -AUTOMAKE = ${SHELL} /home/ziggi/projects/cworker/missing automake +AUTOCONF = ${SHELL} /home/ziggi/Projects/cworker/missing autoconf +AUTOHEADER = ${SHELL} /home/ziggi/Projects/cworker/missing autoheader +AUTOMAKE = ${SHELL} /home/ziggi/Projects/cworker/missing automake AWK = gawk CC = clang CCDEPMODE = depmode=none @@ -286,7 +286,7 @@ LIPO = LN_S = ln -s LTLIBOBJS = LT_SYS_LIBRARY_PATH = -MAKEINFO = ${SHELL} /home/ziggi/projects/cworker/missing makeinfo +MAKEINFO = ${SHELL} /home/ziggi/Projects/cworker/missing makeinfo MANIFEST_TOOL = : MKDIR_P = /usr/local/bin/gmkdir -p NM = /usr/bin/nm @@ -310,10 +310,10 @@ SHELL = /bin/sh STRIP = strip VALGRIND = /usr/local/bin/valgrind VERSION = 0.0.1 -abs_builddir = /home/ziggi/projects/cworker -abs_srcdir = /home/ziggi/projects/cworker -abs_top_builddir = /home/ziggi/projects/cworker -abs_top_srcdir = /home/ziggi/projects/cworker +abs_builddir = /home/ziggi/Projects/cworker +abs_srcdir = /home/ziggi/Projects/cworker +abs_top_builddir = /home/ziggi/Projects/cworker +abs_top_srcdir = /home/ziggi/Projects/cworker ac_ct_AR = ar ac_ct_CC = clang ac_ct_DUMPBIN = @@ -322,13 +322,13 @@ am__leading_dot = . am__quote = am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - -app_cachedir = /home/ziggi/projects/cworker/cache -app_configdir = /home/ziggi/projects/cworker/ -app_databasedir = /home/ziggi/projects/cworker/data -app_libdir = /home/ziggi/projects/cworker/lib -app_logdir = /home/ziggi/projects/cworker/log +app_cachedir = /home/ziggi/Projects/cworker/cache +app_configdir = /home/ziggi/Projects/cworker/ +app_databasedir = /home/ziggi/Projects/cworker/data +app_libdir = /home/ziggi/Projects/cworker/lib +app_logdir = /home/ziggi/Projects/cworker/log app_name = cworker -app_rundir = /home/ziggi/projects/cworker/run +app_rundir = /home/ziggi/Projects/cworker/run app_user = ziggi bindir = ${exec_prefix}/bin build = amd64-unknown-freebsd12.4 @@ -350,7 +350,7 @@ host_vendor = unknown htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/ziggi/projects/cworker/install-sh +install_sh = ${SHELL} /home/ziggi/Projects/cworker/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale diff --git a/clib/Makefile.am b/clib/Makefile.am index 4f996eb..484d511 100644 --- a/clib/Makefile.am +++ b/clib/Makefile.am @@ -1,5 +1,5 @@ -AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo +AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo SUFFIXES = .c .o AM_CFLAGS = -Wall diff --git a/clib/Makefile.in b/clib/Makefile.in index 15e7450..a935e0b 100644 --- a/clib/Makefile.in +++ b/clib/Makefile.in @@ -377,7 +377,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo +AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo SUFFIXES = .c .o AM_CFLAGS = -Wall AM_LDFLAGS = -pthread diff --git a/clib/jblock.c b/clib/jblock.c index d623634..102a30d 100644 --- a/clib/jblock.c +++ b/clib/jblock.c @@ -23,6 +23,13 @@ void jblock_init(jblock_t* jb) { jb->kvarr = malloc(sizeof(jkeyval_t) * INIT_CAPA); } +jblock_t* new_jblock() { + jblock_t* jb = malloc(sizeof(jblock_t)); + if (jb == NULL) return NULL; + jblock_init(jb); + return jb; +} + static void* jblock_checkalloc(jblock_t* jb) { if (jb->kvsize == jb->kvcapa) { size_t newsize = jb->kvcapa * 2; @@ -161,19 +168,44 @@ void jblock_outjson(jblock_t* jb, char** res) { void jblock_destroy(jblock_t* jb) { if (jb == NULL) return; for (int i = 0; i < jb->kvsize; i++) { - free(jb->kvarr[i].key); switch (jb->kvarr[i].type) { + case JKVTYPE_BLK: { + jblock_destroy(jb->kvarr[i].blk); + break; + } + //case JKVTYPE_BLKARR: { + // break; + //} case JKVTYPE_STR: { free(jb->kvarr[i].str); + break; + } + case JKVTYPE_INTARR: { + //free(jb->kvarr[i].numarr); + break; + } + case JKVTYPE_BOOLARR: { + //free(jb->kvarr[i].flagarr); + break; + } + case JKVTYPE_FLTARR: { + //free(jb->kvarr[i].fltarr); + break; } } + free(jb->kvarr[i].key); } jb->kvsize = 0; jb->kvcapa = 0; jb->kvarr = NULL; } +void jblock_free(jblock_t* jb) { + jblock_destroy(jb); + free(jb); +} +/* String container */ static void* jstring_init(jstring_t* str) { str->data = malloc(INIT_CAPA + 1); if (str->data == NULL) return NULL; @@ -188,7 +220,7 @@ static void* jstring_append(jstring_t* str, char* add) { size_t addsize = strlen(add); size_t newsize = str->size + addsize; if (newsize > str->capa) { - char* newstr = malloc(newsize + 1); + char* newstr = realloc(str->data, newsize + 1); if (newstr == NULL) return NULL; } strcpy(&(str->data[str->size]), add); @@ -202,6 +234,118 @@ static char* jstring_getref(jstring_t* str) { return str->data; } +/* Integer array */ +jintarr_t* new_jintarr(void) { + jintarr_t* arr = malloc(sizeof(jintarr_t)); + if (arr == NULL) return NULL; + if (jintarr_init(arr) == NULL) { + jintarr_free(arr); + return NULL; + } + return arr; +} + +void* jintarr_init(jintarr_t* array) { + array->data = malloc(INIT_CAPA * sizeof(int64_t)); + if (array->data == NULL) return NULL; + memset(array->data, 0, INIT_CAPA); + array->capa = INIT_CAPA; + array->size = 0; + return array->data; +} + +void* jintarr_append(jintarr_t* array, int64_t add) { + if (array->size + 1 > array->capa) { + size_t newcapa = (array->capa * 10) / 6 ; + int64_t* newarray = realloc(array->data, newcapa); + if (newarray == NULL) return NULL; + array->capa = newcapa; + array->data = newarray; + } + array->data[array->size++] = add; + return array->data; +} + +int64_t* jintarr_getref(jintarr_t* array) { + return array->data; +} + +void jintarr_destroy(jintarr_t* array) { + if (array == NULL) return; + free(array->data); +} + +void jintarr_free(jintarr_t* array) { + jintarr_destroy(array); + free(array->data); +} + + +/* Float array */ +void* jfltarr_init(jfltarr_t* array) { + array->data = malloc(INIT_CAPA * sizeof(double)); + if (array->data == NULL) return NULL; + memset(array->data, 0, INIT_CAPA); + array->capa = INIT_CAPA; + array->size = 0; + return array->data; +} + +void* jfltarr_append(jfltarr_t* array, double add) { + if (array->size + 1 > array->capa) { + size_t newcapa = (array->capa * 10) / 6 ; + double* newarray = realloc(array->data, newcapa); + if (newarray == NULL) return NULL; + array->capa = newcapa; + array->data = newarray; + } + array->data[array->size++] = add; + return array->data; +} + +double* jfltarr_getref(jfltarr_t* array) { + return array->data; +} + +void jfltarr_destroy(jfltarr_t* array) { + if (array == NULL) return; + free(array->data); +} + + +/* Bool array */ +void* jboolarr_init(jboolarr_t* array) { + array->data = malloc(INIT_CAPA * sizeof(bool)); + if (array->data == NULL) return NULL; + memset(array->data, 0, INIT_CAPA); + array->capa = INIT_CAPA; + array->size = 0; + return array->data; +} + +void* jboolarr_append(jboolarr_t* array, bool add) { + if (array->size + 1 > array->capa) { + size_t newcapa = (array->capa * 10) / 6 ; + bool* newarray = realloc(array->data, newcapa); + if (newarray == NULL) return NULL; + array->capa = newcapa; + array->data = newarray; + } + array->data[array->size++] = add; + return array->data; +} + +bool* jboolarr_getref(jboolarr_t* array) { + return array->data; +} + +void jboolarr_destroy(jboolarr_t* array) { + if (array == NULL) return; + free(array->data); +} + + +/* Tools */ static char* strcopy(char* src) { size_t srcsize = strlen(src) + 1; char* dst = malloc(srcsize); diff --git a/clib/jblock.h b/clib/jblock.h index 967208c..b05e5de 100644 --- a/clib/jblock.h +++ b/clib/jblock.h @@ -5,56 +5,106 @@ #include #include + typedef struct { char* data; int capa; int size; } jstring_t; +typedef struct { + int64_t* data; + int capa; + int size; +} jintarr_t; + +typedef struct { + bool* data; + int capa; + int size; +} jboolarr_t; + +typedef struct { + double* data; + int capa; + int size; +} jfltarr_t; + + +typedef struct jblock jblock_t; typedef struct { char* key; int type; union { - int64_t num; - bool flag; - char* str; - double flt; - int64_t* numarr; - char** strarr; - double* fltarr; - bool* flagarr; + int64_t num; + bool flag; + char* str; + double flt; + jintarr_t numarr; + jfltarr_t fltarr; + jboolarr_t flagarr; + jblock_t* blk; + jblock_t* blkarr; + char** strarr; + }; int arrsize; int arrcapa; } jkeyval_t; -typedef struct { +struct jblock { jkeyval_t* kvarr; int kvsize; int kvcapa; -} jblock_t; +}; #define JKVTYPE_INT 0x01 #define JKVTYPE_STR 0x02 #define JKVTYPE_BOOL 0x03 #define JKVTYPE_FLT 0x04 +#define JKVTYPE_BLK 0x05 #define JKVTYPE_INTARR 0x11 #define JKVTYPE_STRARR 0x12 #define JKVTYPE_BOOLARR 0x13 #define JKVTYPE_FLTARR 0x14 +#define JKVTYPE_BLKARR 0x15 + #define JB_MALLOCERR -1 #define JB_KEYEXISTS -2 +jblock_t* new_jblock(); +void jblock_init(jblock_t* block); +void jblock_outjson(jblock_t* block, char** res); +void jblock_destroy(jblock_t* block); +void jblock_free(jblock_t* jb); + +int jblock_addint(jblock_t* block, char* key, int64_t val); +int jblock_addfloat(jblock_t* block, char* key, double val); +int jblock_addstr(jblock_t* block, char* key, char* val); +int jblock_addbool(jblock_t* block, char* key, bool val); + +jintarr_t* new_jintarr(void); +void* jintarr_init(jintarr_t* array); +void* jintarr_append(jintarr_t* array, int64_t add); +int64_t* jintarr_getref(jintarr_t* array); +void jintarr_destroy(jintarr_t* array); +void jintarr_free(jintarr_t* array); + +jfltarr_t* new_jfltarr(void); +void* jfltarr_init(jfltarr_t* array); +void* jfltarr_append(jfltarr_t* array, double add); +double* jfltarr_getref(jfltarr_t* array); +void jfltarr_destroy(jfltarr_t* array); +void jfltarr_free(jfltarr_t* array); -void jblock_init(jblock_t* kv); -void jblock_outjson(jblock_t* kv, char** res); -void jblock_destroy(jblock_t* kv); +jboolarr_t* new_jboolarr(void); +void* jboolarr_init(jboolarr_t* array); +void* jboolarr_append(jboolarr_t* array, bool add); +bool* jboolarr_getref(jboolarr_t* array); +void jboolarr_destroy(jboolarr_t* array); +void jboolarr_free(jboolarr_t* array); -int jblock_addint(jblock_t* kv, char* key, int64_t val); -int jblock_addfloat(jblock_t* kv, char* key, double val); -int jblock_addstr(jblock_t* kv, char* key, char* val); -int jblock_addbool(jblock_t* kv, char* key, bool val); #endif diff --git a/clib/jblock_test.c b/clib/jblock_test.c index 82dcbb8..c05fc9e 100644 --- a/clib/jblock_test.c +++ b/clib/jblock_test.c @@ -12,25 +12,54 @@ void test01(void) { - jblock_t jb; + jblock_t* jb = new_jblock(); - jblock_init(&jb); - jblock_addint(&jb, "id1", 12345); - jblock_addstr(&jb, "id2", "qwerty"); - jblock_addbool(&jb, "b1", true); - jblock_addbool(&jb, "b2", false); - jblock_addfloat(&jb, "f1", (double)123e1); + jblock_init(jb); + jblock_addint(jb, "id1", 12345); + jblock_addstr(jb, "id2", "qwerty"); + jblock_addbool(jb, "b1", true); + jblock_addbool(jb, "b2", false); + jblock_addfloat(jb, "f1", (double)123e1); char* jsonstr = NULL; - jblock_outjson(&jb, &jsonstr); - jblock_destroy(&jb); + jblock_outjson(jb, &jsonstr); + jblock_free(jb); printf("%s\n", jsonstr); free(jsonstr); } +void test02(void) { + jintarr_t* arr = new_jintarr(); + jintarr_init(arr); + + for (int64_t i = 0; i < 1024 + 1; i++) { + jintarr_append(arr, i); + } + printf("size: %d capa: %d\n", arr->size, arr->capa); + printf("last: %ld\n", arr->data[arr->size - 1]); + + jintarr_free(arr); + +} + +void test03(void) { + jfltarr_t arr; + jfltarr_init(&arr); + + for (int64_t i = 0; i < 1024 + 1; i++) { + jfltarr_append(&arr, i); + } + printf("size: %d capa: %d\n", arr.size, arr.capa); + printf("last: %f\n", arr.data[arr.size - 1]); + + jfltarr_destroy(&arr); +} + int main(void) { - test01(); + //test01(); + test02(); + test03(); return 0; } diff --git a/clib/jlexer.c b/clib/jlexer.c index f288216..4e533a2 100644 --- a/clib/jlexer.c +++ b/clib/jlexer.c @@ -10,25 +10,27 @@ #include #include -#define JLEXCONT_UNDEF 0 -#define JLEXCONT_WORD 1 -#define JLEXCONT_BLOCKB 2 -#define JLEXCONT_BLOCKE 3 -#define JLEXCONT_SEPAR 4 -#define JLEXCONT_NUM 5 -#define JLEXCONT_UNKNOW 6 -#define JLEXCONT_END 9 - -#define JLEXTYPE_UNDEF 0 -#define JLEXTYPE_BLOCKB 1 -#define JLEXTYPE_BLOCKE 2 -#define JLEXTYPE_WORDL 3 -#define JLEXTYPE_SPACE 4 -#define JLEXTYPE_SEPAR 5 -#define JLEXTYPE_NUM 6 -#define JLEXTYPE_COMMA 7 -#define JLEXTYPE_CHAR 8 -#define JLEXTYPE_EOF 9 +#define JLEXCONT_UNDEF 0x00 +#define JLEXCONT_WORD 0x01 +#define JLEXCONT_BLOCKB 0x02 +#define JLEXCONT_BLOCKE 0x03 +#define JLEXCONT_SEPAR 0x04 +#define JLEXCONT_NUM 0x05 +#define JLEXCONT_UNKNOW 0x06 +#define JLEXCONT_END 0x99 + +#define JLEXTYPE_UNDEF 0x00 +#define JLEXTYPE_BLOCKB 0x01 +#define JLEXTYPE_BLOCKE 0x02 +#define JLEXTYPE_WORDL 0x03 +#define JLEXTYPE_SPACE 0x04 +#define JLEXTYPE_SEPAR 0x05 +#define JLEXTYPE_NUM 0x06 +#define JLEXTYPE_COMMA 0x07 +#define JLEXTYPE_CHAR 0x08 +#define JLEXTYPE_ARRB 0x11 +#define JLEXTYPE_ARRE 0x12 +#define JLEXTYPE_EOF 0x99 static int get_ltype(char letter) { @@ -39,6 +41,10 @@ static int get_ltype(char letter) { return JLEXTYPE_BLOCKB; case '}': return JLEXTYPE_BLOCKE; + case '[': + return JLEXTYPE_ARRB; + case ']': + return JLEXTYPE_ARRE; case '"': return JLEXTYPE_WORDL; case ' ': @@ -113,6 +119,16 @@ int jlexer_gettoken(jlexer_t * lexer, char* token) { lexer->context = JLEXCONT_UNDEF; return JLEXTOK_BLOCKE; } + case JLEXTYPE_ARRB:{ + strcpy(token, "ARR BEGIN"); + lexer->context = JLEXCONT_UNDEF; + return JLEXTOK_ARRB; + } + case JLEXTYPE_ARRE:{ + strcpy(token, "ARR END"); + lexer->context = JLEXCONT_UNDEF; + return JLEXTOK_ARRE; + } case JLEXTYPE_SEPAR:{ strcpy(token, "IS"); lexer->context = JLEXCONT_UNDEF; diff --git a/clib/jlexer.h b/clib/jlexer.h index 18dc773..f40bcae 100644 --- a/clib/jlexer.h +++ b/clib/jlexer.h @@ -16,16 +16,18 @@ typedef struct { -#define JLEXTOK_BLOCKB 1 -#define JLEXTOK_BLOCKE 2 -#define JLEXTOK_SPACE 4 -#define JLEXTOK_SEPAR 3 -#define JLEXTOK_UNDEF 4 -#define JLEXTOK_WORD 5 -#define JLEXTOK_NUMB 6 -#define JLEXTOK_UNKNOW 7 -#define JLEXTOK_NEXT 8 -#define JLEXTOK_END 9 +#define JLEXTOK_BLOCKB 0x01 +#define JLEXTOK_BLOCKE 0x02 +#define JLEXTOK_SPACE 0x04 +#define JLEXTOK_SEPAR 0x03 +#define JLEXTOK_UNDEF 0x04 +#define JLEXTOK_WORD 0x05 +#define JLEXTOK_NUMB 0x06 +#define JLEXTOK_UNKNOW 0x07 +#define JLEXTOK_NEXT 0x08 +#define JLEXTOK_ARRB 0x10 +#define JLEXTOK_ARRE 0x11 +#define JLEXTOK_END 0x99 diff --git a/clib/jlexer_test.c b/clib/jlexer_test.c index 6fb50ae..fbcbdff 100644 --- a/clib/jlexer_test.c +++ b/clib/jlexer_test.c @@ -32,9 +32,9 @@ int main(void) { int type = 0; while ((type = jlexer_gettoken(&lexer, token)) != JLEXTOK_END) { - printf("%d: %s\n", type, token); + printf("%02x: %s\n", type, token); } - printf("%d: %s\n", type, token); + printf("%02x: %s\n", type, token); rcache_destroy(&cache); diff --git a/clib/jparser.c b/clib/jparser.c index eba39b3..b8da387 100644 --- a/clib/jparser.c +++ b/clib/jparser.c @@ -31,6 +31,7 @@ void jparser_init(jparser_t * parser, jlexer_t * lexer) { #define MAX_TOKEN_SIZE 1024 + int jparser_parse(jparser_t * parser) { jlexer_t* lex = parser->lexer; char token[MAX_TOKEN_SIZE]; @@ -40,7 +41,7 @@ int jparser_parse(jparser_t * parser) { char* key = ""; while ((type = jlexer_gettoken(lex, token)) != JLEXTOK_END) { - //printf("pos %d %d: %s\n", pos, type, token); + printf("pos %d tok 0x%02x: %s\n", pos, type, token); switch (pos) { // POS 0 case 0:{ diff --git a/clib/jparser.h b/clib/jparser.h index 445cb47..52c3e96 100644 --- a/clib/jparser.h +++ b/clib/jparser.h @@ -23,9 +23,10 @@ typedef struct { jlexer_t* lexer; } jparser_t; -#define JVALTYPE_STR 1 -#define JVALTYPE_NUM 2 -#define JVALTYPE_BOOL 3 +#define JVALTYPE_STR 0x01 +#define JVALTYPE_NUM 0x02 +#define JVALTYPE_BOOL 0x03 +#define JVALTYPE_BLK 0x04 void jparser_init(jparser_t* parser, jlexer_t* lexer); diff --git a/clib/jparser_test.c b/clib/jparser_test.c index 75d2071..029d019 100644 --- a/clib/jparser_test.c +++ b/clib/jparser_test.c @@ -40,14 +40,14 @@ int main(void) { int64_t id = 0; if (jparser_bind(&parser, JVALTYPE_NUM, "id", (void *)&id) < 0) { - log_error("cannot bind variable\n"); + log_error("cannot bind id variable\n"); return 1; } char* name = ""; if (jparser_bind(&parser, JVALTYPE_STR, "name", (void *)&name) < 0) { - log_error("cannot bind variable\n"); + log_error("cannot bind name variable\n"); } printf("id = %ld\n", id); diff --git a/config.h b/config.h index 1d4b43c..135d01d 100644 --- a/config.h +++ b/config.h @@ -2,8 +2,8 @@ #ifndef CONFIG_H_QWER #define CONFIG_H_QWER -static const char *srv_runpath = "/home/ziggi/projects/cworker/run/cworker.pid"; -static const char *srv_logpath = "/home/ziggi/projects/cworker/log/cworker.log"; -static const char *srv_configpath = "/home/ziggi/projects/cworker//cworker.conf"; +static const char *srv_runpath = "/home/ziggi/Projects/cworker/run/cworker.pid"; +static const char *srv_logpath = "/home/ziggi/Projects/cworker/log/cworker.log"; +static const char *srv_configpath = "/home/ziggi/Projects/cworker//cworker.conf"; #endif diff --git a/config.status b/config.status index 6bd84c7..5a04bb9 100755 --- a/config.status +++ b/config.status @@ -430,7 +430,7 @@ Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -ac_pwd='/home/ziggi/projects/cworker' +ac_pwd='/home/ziggi/Projects/cworker' srcdir='.' INSTALL='/usr/bin/install -c' MKDIR_P='/usr/local/bin/gmkdir -p' @@ -811,20 +811,20 @@ S["am__EXEEXT_FALSE"]="" S["am__EXEEXT_TRUE"]="#" S["LTLIBOBJS"]="" S["app_name"]="cworker" -S["app_cachedir"]="/home/ziggi/projects/cworker/cache" -S["APP_CACHEDIR"]="/home/ziggi/projects/cworker/cache" -S["app_databasedir"]="/home/ziggi/projects/cworker/data" -S["APP_DATABASEDIR"]="/home/ziggi/projects/cworker/data" +S["app_cachedir"]="/home/ziggi/Projects/cworker/cache" +S["APP_CACHEDIR"]="/home/ziggi/Projects/cworker/cache" +S["app_databasedir"]="/home/ziggi/Projects/cworker/data" +S["APP_DATABASEDIR"]="/home/ziggi/Projects/cworker/data" S["app_user"]="ziggi" S["APP_USER"]="ziggi" -S["app_libdir"]="/home/ziggi/projects/cworker/lib" -S["APP_LIBDIR"]="/home/ziggi/projects/cworker/lib" -S["app_rundir"]="/home/ziggi/projects/cworker/run" -S["APP_RUNDIR"]="/home/ziggi/projects/cworker/run" -S["app_logdir"]="/home/ziggi/projects/cworker/log" -S["APP_LOGDIR"]="/home/ziggi/projects/cworker/log" -S["app_configdir"]="/home/ziggi/projects/cworker/" -S["APP_CONFIGDIR"]="/home/ziggi/projects/cworker/" +S["app_libdir"]="/home/ziggi/Projects/cworker/lib" +S["APP_LIBDIR"]="/home/ziggi/Projects/cworker/lib" +S["app_rundir"]="/home/ziggi/Projects/cworker/run" +S["APP_RUNDIR"]="/home/ziggi/Projects/cworker/run" +S["app_logdir"]="/home/ziggi/Projects/cworker/log" +S["APP_LOGDIR"]="/home/ziggi/Projects/cworker/log" +S["app_configdir"]="/home/ziggi/Projects/cworker/" +S["APP_CONFIGDIR"]="/home/ziggi/Projects/cworker/" S["SYSTEMD_FALSE"]="" S["SYSTEMD_TRUE"]="#" S["LINUX_OS_FALSE"]="" @@ -898,12 +898,12 @@ S["mkdir_p"]="$(MKDIR_P)" S["MKDIR_P"]="/usr/local/bin/gmkdir -p" S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" S["STRIP"]="strip" -S["install_sh"]="${SHELL} /home/ziggi/projects/cworker/install-sh" -S["MAKEINFO"]="${SHELL} /home/ziggi/projects/cworker/missing makeinfo" -S["AUTOHEADER"]="${SHELL} /home/ziggi/projects/cworker/missing autoheader" -S["AUTOMAKE"]="${SHELL} /home/ziggi/projects/cworker/missing automake" -S["AUTOCONF"]="${SHELL} /home/ziggi/projects/cworker/missing autoconf" -S["ACLOCAL"]="${SHELL} /home/ziggi/projects/cworker/missing aclocal" +S["install_sh"]="${SHELL} /home/ziggi/Projects/cworker/install-sh" +S["MAKEINFO"]="${SHELL} /home/ziggi/Projects/cworker/missing makeinfo" +S["AUTOHEADER"]="${SHELL} /home/ziggi/Projects/cworker/missing autoheader" +S["AUTOMAKE"]="${SHELL} /home/ziggi/Projects/cworker/missing automake" +S["AUTOCONF"]="${SHELL} /home/ziggi/Projects/cworker/missing autoconf" +S["ACLOCAL"]="${SHELL} /home/ziggi/Projects/cworker/missing aclocal" S["VERSION"]="0.0.1" S["PACKAGE"]="cworker" S["CYGPATH_W"]="echo" @@ -1037,13 +1037,13 @@ D["HAVE_MEMSET"]=" 1" D["HAVE_MKDIR"]=" 1" D["HAVE_SETLOCALE"]=" 1" D["HAVE_SOCKET"]=" 1" -D["APP_CONFIGDIR"]=" \"/home/ziggi/projects/cworker/\"" -D["APP_LOGDIR"]=" \"/home/ziggi/projects/cworker/log\"" -D["APP_RUNDIR"]=" \"/home/ziggi/projects/cworker/run\"" -D["APP_LIBDIR"]=" \"/home/ziggi/projects/cworker/lib\"" +D["APP_CONFIGDIR"]=" \"/home/ziggi/Projects/cworker/\"" +D["APP_LOGDIR"]=" \"/home/ziggi/Projects/cworker/log\"" +D["APP_RUNDIR"]=" \"/home/ziggi/Projects/cworker/run\"" +D["APP_LIBDIR"]=" \"/home/ziggi/Projects/cworker/lib\"" D["APP_USER"]=" \"ziggi\"" -D["APP_DATABASEDIR"]=" \"/home/ziggi/projects/cworker/data\"" -D["APP_CACHEDIR"]=" \"/home/ziggi/projects/cworker/cache\"" +D["APP_DATABASEDIR"]=" \"/home/ziggi/Projects/cworker/data\"" +D["APP_CACHEDIR"]=" \"/home/ziggi/Projects/cworker/cache\"" for (key in D) D_is_set[key] = 1 FS = "" } diff --git a/defines.h b/defines.h index 721850c..93ab960 100644 --- a/defines.h +++ b/defines.h @@ -2,22 +2,22 @@ /* defines.h.in. Generated from configure.ac by autoheader. */ /* location of cache dir */ -#define APP_CACHEDIR "/home/ziggi/projects/cworker/cache" +#define APP_CACHEDIR "/home/ziggi/Projects/cworker/cache" /* location of configuration files for ${PACKAGE} */ -#define APP_CONFIGDIR "/home/ziggi/projects/cworker/" +#define APP_CONFIGDIR "/home/ziggi/Projects/cworker/" /* location of database dir */ -#define APP_DATABASEDIR "/home/ziggi/projects/cworker/data" +#define APP_DATABASEDIR "/home/ziggi/Projects/cworker/data" /* location of libs */ -#define APP_LIBDIR "/home/ziggi/projects/cworker/lib" +#define APP_LIBDIR "/home/ziggi/Projects/cworker/lib" /* location of ${PACKAGE} logdir */ -#define APP_LOGDIR "/home/ziggi/projects/cworker/log" +#define APP_LOGDIR "/home/ziggi/Projects/cworker/log" /* location of pid file */ -#define APP_RUNDIR "/home/ziggi/projects/cworker/run" +#define APP_RUNDIR "/home/ziggi/Projects/cworker/run" /* effective user */ #define APP_USER "ziggi"