Index: ossp-pkg/lmtp2nntp/00TODO RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/00TODO,v rcsdiff -q -kk '-r1.28' '-r1.29' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/00TODO,v' 2>/dev/null --- 00TODO 2001/09/10 06:50:56 1.28 +++ 00TODO 2001/09/10 10:16:05 1.29 @@ -14,12 +14,6 @@ FIXME -check str library version -- openpkg (package time) -- autoconf, (autoconf time) -- str.h, #err (compile time) -- STR_VERSION (run time) - check gcc3 compatiblity **** DEVELOPMENT INFORMATION **** Index: ossp-pkg/lmtp2nntp/lmtp2nntp.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp2nntp.c,v rcsdiff -q -kk '-r1.46' '-r1.47' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp2nntp.c,v' 2>/dev/null --- lmtp2nntp.c 2001/09/10 06:54:06 1.46 +++ lmtp2nntp.c 2001/09/10 10:16:05 1.47 @@ -39,6 +39,22 @@ #include "shpat_match.h" #include "l2.h" +/* library version check (compile-time) */ +#define L2_VERSION_HEX_REQ 0x001200 +#define L2_VERSION_STR_REQ "0.1.0" +#define STR_VERSION_HEX_REQ 0x009205 +#define STR_VERSION_STR_REQ "0.9.5" +#ifdef L2_VERSION_HEX +#if L2_VERSION_HEX < L2_VERSION_HEX_REQ +#error "require a newer version of OSSP L2" +#endif +#endif +#ifdef STR_VERSION_HEX +#if STR_VERSION_HEX < STR_VERSION_HEX_REQ +#error "require a newer version of OSSP Str" +#endif +#endif + /* own headers */ #include "lmtp2nntp.h" #ifdef HAVE_CONFIG_H @@ -257,6 +273,16 @@ l2_channel_t *chBuf; l2_channel_t *chFile; + /* library version check (run-time) */ + if (l2_version.v_hex < L2_VERSION_HEX_REQ) { + fprintf(stderr, "require at least OSSP L2 >= %s\n", L2_VERSION_STR_REQ); + exit(ERR_EXECUTION); + } + if (str_version.v_hex < STR_VERSION_HEX_REQ + 1) { + fprintf(stderr, "require at least OSSP Str >= %s\n", STR_VERSION_STR_REQ); + exit(ERR_EXECUTION); + } + /* create application context */ if ((ctx = (lmtp2nntp_t *)malloc(sizeof(lmtp2nntp_t))) == NULL) exit(ERR_EXECUTION);