X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fconf-test.c;h=47eff30ba223e3a00d06ac5da83acf3eb06fb3d4;hb=271d2a02e7b798fd9781018c060d49e47f277cba;hp=6e9891c3434fae66d8118b20de749e83126c369b;hpb=a7cb891bfea5a2e47d91612eb6dd728dfbfbd45a;p=libucw.git diff --git a/lib/conf-test.c b/lib/conf-test.c index 6e9891c3..47eff30b 100644 --- a/lib/conf-test.c +++ b/lib/conf-test.c @@ -1,16 +1,16 @@ /* Test for configuration parser */ -#include -#include -#include - #include "lib/lib.h" #include "lib/conf.h" -static int robert=14; +#include +#include + +static u64 robert=14; static int spalek=-3; static char *heslo="prazdne"; static int nastaveni1=0,nastaveni2=1; +static double decker = 0; /* The famous London buses :-) */ static byte *set_nastaveni(struct cfitem *item, byte *value) { @@ -36,11 +36,12 @@ static byte *set_nastaveni(struct cfitem *item, byte *value) static struct cfitem jmeno[]={ {"jmeno", CT_SECTION, NULL}, - {"robert", CT_INT, &robert}, + {"robert", CT_U64, &robert}, {"spalek", CT_INT, &spalek}, {"heslo", CT_STRING, &heslo}, {"nastaveni1", CT_FUNCTION, &set_nastaveni}, {"nastaveni2", CT_FUNCTION, &set_nastaveni}, + {"decker", CT_DOUBLE, &decker}, {NULL, CT_STOP, NULL} }; @@ -73,7 +74,7 @@ int main(int argc, char *argv[]) { int c; - initlog(argv[0]); + log_init(argv[0]); cf_register(jmeno); cf_register(telo); @@ -119,8 +120,8 @@ int main(int argc, char *argv[]) printf ("\n"); } - printf("robert=%d, spalek=%d, heslo=%s, nastaveni1/2=%d/%d\n", - robert,spalek,heslo,nastaveni1,nastaveni2); + printf("robert=%Ld, spalek=%d, heslo=%s, nastaveni1/2=%d/%d decker=%f\n", + (long long)robert,spalek,heslo,nastaveni1,nastaveni2,decker); printf("vek=%d, vyska=%d, vaha=%d\n", vek,vyska,vaha);