X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=para.h;h=f22157d8ae6063969ffabfd29e3e0ecb21cf0af1;hb=ad14b0d7021aa16a71098eeb70eaba66017ec53a;hp=fc0edf9a43df1e3840c5c55fe49740256f1a364c;hpb=b9f9601828dd1a103ec9315bd430d39b458d2b80;p=paraslash.git diff --git a/para.h b/para.h index fc0edf9a..f22157d8 100644 --- a/para.h +++ b/para.h @@ -38,13 +38,14 @@ #include #include "gcc-compat.h" -/* some internal constants */ -#define STRINGSIZE 4096 +/** used in various contexts */ #define MAXLINE 255 - +/** compute the minimum of \a a and \a b */ #define PARA_MIN(a,b) ((a) < (b) ? (a) : (b)) +/** compute the maximum of \a a and \a b */ #define PARA_MAX(a,b) ((a) > (b) ? (a) : (b)) +/** compute the absolute value of \a a */ #define PARA_ABS(a) ((a) > 0 ? (a) : -(a)) /* Loglevels */ @@ -56,8 +57,8 @@ #define CRIT 6 #define EMERG 7 - #define COMPILE_TIME_LOGLEVEL 0 + #if DEBUG > COMPILE_TIME_LOGLEVEL #define PARA_DEBUG_LOG(f,...) para_log(DEBUG, "%s: " f, __FUNCTION__, __VA_ARGS__) #else @@ -119,10 +120,18 @@ } -#define COPYRIGHT "Copyright (c) 1997-2006 by Andre Noll" +#define VERSION_TEXT(prefix) "para_" prefix " " PACKAGE_VERSION "\n" \ + "Copyright (C) 2007 Andre Noll\n" \ + "This is free software with ABSOLUTELY NO WARRANTY." \ + " See COPYING for details.\n" \ + "Written by Andre Noll.\n" \ + "Report bugs to .\n" -#define LICENSE "This is free software with ABSOLUTELY NO WARRANTY. " \ - "See COPYING for details." +#define HANDLE_VERSION_FLAG(_prefix, _args_info_struct) \ + if (_args_info_struct.version_given) { \ + printf("%s", VERSION_TEXT(_prefix)); \ + exit(EXIT_SUCCESS); \ + } #define AWAITING_DATA_MSG "\nAwaiting Data." #define PROCEED_MSG "\nProceed.\n"