libmsngr  1.1
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups
msngr_version.c
Go to the documentation of this file.
1 /*******************************************************************************
2 *
3 * COPYRIGHT (C) 2010 Battelle Memorial Institute. All Rights Reserved.
4 *
5 ********************************************************************************
6 *
7 * Author:
8 * name: Brian Ermold
9 * phone: (509) 375-2277
10 * email: brian.ermold@pnl.gov
11 *
12 ********************************************************************************
13 *
14 * REPOSITORY INFORMATION:
15 * $Revision: 13168 $
16 * $Author: ermold $
17 * $Date: 2012-03-24 01:49:45 +0000 (Sat, 24 Mar 2012) $
18 *
19 ********************************************************************************
20 *
21 * NOTE: DOXYGEN is used to generate documentation for this file.
22 *
23 *******************************************************************************/
24 
25 /** @file msngr_version.c
26  * libmsngr library version.
27  */
28 
29 /**
30  * @defgroup MSNGR_VERSION Library Version
31  */
32 /*@{*/
33 
34 /** @privatesection */
35 
36 static char *_VersionTag = "$Version: afl-libmsngr-1.6 $";
37 static char _Version[64];
38 
39 /** @publicsection */
40 
41 /**
42  * libmsngr library version.
43  *
44  * @return libmsngr library version
45  */
46 const char *msngr_lib_version(void)
47 {
48  char *tp = _VersionTag;
49  char *vp = _Version;
50 
51  if (!*vp) {
52 
53  /* find colon */
54 
55  for (; *tp != ':'; tp++)
56  if (*tp == '\0') return((const char *)_Version);
57 
58  /* skip spaces */
59 
60  for (tp++; *tp == ' '; tp++)
61  if (*tp == '\0') return((const char *)_Version);
62 
63  /* extract version from tag */
64 
65  while (*tp != ' ' && *tp != '$' && *tp != '\0')
66  *vp++ = *tp++;
67 
68  *vp = '\0';
69  }
70 
71  return((const char *)_Version);
72 }
73 
74 /*@}*/