From 6ba4b7e94d1d3b81cb5eea80ddb5b62f1f124787 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Mon, 18 Feb 2008 07:38:54 +0000 Subject: [PATCH] Added version information to elog.c SVN revision: 2050 --- NT/elogd.sln | 1 + NT/elogd.vcproj | 2 +- checklist.txt | 2 +- src/elog.c | 43 ++++++++++++++++++++++++++++--------------- 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/NT/elogd.sln b/NT/elogd.sln index 2fcfe4a8..f3aea9d9 100755 --- a/NT/elogd.sln +++ b/NT/elogd.sln @@ -17,6 +17,7 @@ Global {8D6EBED8-48F3-4719-907E-7BE46A3C0FA4}.Debug|Win32.ActiveCfg = Debug|Win32 {8D6EBED8-48F3-4719-907E-7BE46A3C0FA4}.Release|Win32.ActiveCfg = Release|Win32 {FD6FCAF3-A94B-40FA-AE52-07705DE2E519}.Debug|Win32.ActiveCfg = Debug|Win32 + {FD6FCAF3-A94B-40FA-AE52-07705DE2E519}.Debug|Win32.Build.0 = Debug|Win32 {FD6FCAF3-A94B-40FA-AE52-07705DE2E519}.Release|Win32.ActiveCfg = Release|Win32 {CB6EB7FE-CC3D-4548-B8B8-8DDA05916759}.Debug|Win32.ActiveCfg = Debug|Win32 {CB6EB7FE-CC3D-4548-B8B8-8DDA05916759}.Debug|Win32.Build.0 = Debug|Win32 diff --git a/NT/elogd.vcproj b/NT/elogd.vcproj index c3629cf8..b240b873 100755 --- a/NT/elogd.vcproj +++ b/NT/elogd.vcproj @@ -44,7 +44,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="\mxml;\openssl\include;" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_SSL" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_SSL1" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" diff --git a/checklist.txt b/checklist.txt index 768832f2..125a6c14 100755 --- a/checklist.txt +++ b/checklist.txt @@ -4,7 +4,7 @@ Checklist for new ELOG version On PC6562: - Put all new options in doc/config.html -- Increse version in elogd.c +- Increse version in elogd.c and elog.c - Do the same in doc/index.html and index_d.html - Modify ChangeLog - Add release date to ChangeLog diff --git a/src/elog.c b/src/elog.c index 0805696d..bf0ef040 100755 --- a/src/elog.c +++ b/src/elog.c @@ -9,6 +9,12 @@ \********************************************************************/ +#define VERSION "2.7.2" +char svn_revision[] = "$Id$"; + +/* ELOG identification */ +static const char ELOGID[] = "elog " VERSION " built " __DATE__ ", " __TIME__; + #include #include #include @@ -898,7 +904,9 @@ INT submit_elog(char *host, int port, char *subdir, char *experiment, /* check response status */ if (strstr(response, "302 Found")) { if (strstr(response, "Location:")) { - if (strstr(response, "fail")) + if (strstr(response, "has moved")) + printf("Error: elogd server has moved to another location\n"); + else if (strstr(response, "fail")) printf("Error: Invalid user name or password\n"); else { strncpy(str, strstr(response, "Location:") + 10, sizeof(str)); @@ -1010,21 +1018,26 @@ int main(int argc, char *argv[]) strcpy(textfile, argv[++i]); else { usage: + printf("%s ", ELOGID); + strcpy(str, svn_revision + 13); + if (strchr(str, ' ')) + *strchr(str, ' ') = 0; + printf("revision %s\n", str); printf("\nusage: elog\n"); - printf(" -h [-p port] [-s subdir]\n"); - printf(" Location where elogd is running\n"); - printf(" -l logbook/experiment Name of logbook or experiment\n"); - printf(" [-v] for verbose output\n"); - printf(" [-w password] write password defined on server\n"); - printf(" [-u username password] user name and password\n"); - printf(" [-f ] (up to %d times)\n", MAX_ATTACHMENTS); - printf(" -a = (up to %d times)\n", MAX_N_ATTR); - printf(" [-r ] Reply to existing message\n"); - printf(" [-q] Quote original text on reply\n"); - printf(" [-e ] Edit existing message\n"); - printf(" [-x] Suppress email notification\n"); - printf(" [-n 0|1|2] Encoding: 0:ELcode,1:plain,2:HTML\n"); - printf(" -m ] | \n"); + printf("elog -h [-p port] [-s subdir]\n"); + printf(" Location where elogd is running\n"); + printf(" -l logbook/experiment Name of logbook or experiment\n"); + printf(" [-v] for verbose output\n"); + printf(" [-w password] write password defined on server\n"); + printf(" [-u username password] user name and password\n"); + printf(" [-f ] (up to %d times)\n", MAX_ATTACHMENTS); + printf(" -a = (up to %d times)\n", MAX_N_ATTR); + printf(" [-r ] Reply to existing message\n"); + printf(" [-q] Quote original text on reply\n"); + printf(" [-e ] Edit existing message\n"); + printf(" [-x] Suppress email notification\n"); + printf(" [-n 0|1|2] Encoding: 0:ELcode,1:plain,2:HTML\n"); + printf(" -m ] | \n"); printf("\nArguments with blanks must be enclosed in quotes\n"); printf("The elog message can either be submitted on the command line, piped in like\n"); printf("\"cat text | elog -h ... -l ... -a ...\" or in a file with the -m flag.\n");