/[dtapublic]/projs/ets/trunk/src/c_tclxtens_7_5/vcinfo.c
ViewVC logotype

Diff of /projs/ets/trunk/src/c_tclxtens_7_5/vcinfo.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 68 by dashley, Mon Oct 31 16:18:20 2016 UTC revision 71 by dashley, Sat Nov 5 11:07:06 2016 UTC
# Line 1  Line 1 
1  //$Header$  //$Header$
2  //-------------------------------------------------------------------------------------------------  //-------------------------------------------------------------------------------------------------
3  //This file is part of "David T. Ashley's Shared Source Code", a set of shared components  //This file is part of "David T. Ashley's Shared Source Code", a set of shared components
4  //integrated into many of David T. Ashley's projects.  //integrated into many of David T. Ashley's projects.
5  //-------------------------------------------------------------------------------------------------  //-------------------------------------------------------------------------------------------------
6  //This source code and any program in which it is compiled/used is provided under the MIT License,  //This source code and any program in which it is compiled/used is provided under the MIT License,
7  //reproduced below.  //reproduced below.
8  //-------------------------------------------------------------------------------------------------  //-------------------------------------------------------------------------------------------------
9  //Permission is hereby granted, free of charge, to any person obtaining a copy of  //Permission is hereby granted, free of charge, to any person obtaining a copy of
10  //this software and associated documentation files(the "Software"), to deal in the  //this software and associated documentation files(the "Software"), to deal in the
11  //Software without restriction, including without limitation the rights to use,  //Software without restriction, including without limitation the rights to use,
12  //copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the  //copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the
13  //Software, and to permit persons to whom the Software is furnished to do so,  //Software, and to permit persons to whom the Software is furnished to do so,
14  //subject to the following conditions :  //subject to the following conditions :
15  //  //
16  //The above copyright notice and this permission notice shall be included in all  //The above copyright notice and this permission notice shall be included in all
17  //copies or substantial portions of the Software.  //copies or substantial portions of the Software.
18  //  //
19  //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE  //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
22  //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24  //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  //SOFTWARE.  //SOFTWARE.
26  //-------------------------------------------------------------------------------------------------  //-------------------------------------------------------------------------------------------------
27  #define MODULE_VCINFO  #define MODULE_VCINFO
28    
29  #include <string.h>  #include <string.h>
30    
31  #include "tcl.h"  #include "tcl.h"
32  #include "tcldecls.h"  #include "tcldecls.h"
33    
34  #include "vcinfo.h"  #include "vcinfo.h"
35    
36  #include "build_config.h"  #include "build_config.h"
37    
38    
39  //Module implements the "vcinfo" command, which emits all version  //Module implements the "vcinfo" command, which emits all version
40  //control information about the build.  //control information about the build.
41    
42  int VcinfoCmd(ClientData dummy,  int VcinfoCmd(ClientData dummy,
43                Tcl_Interp *interp,                Tcl_Interp *interp,
44                     int objc,                     int objc,
45                     Tcl_Obj *objv[])                     Tcl_Obj *objv[])
46     {     {
47          Tcl_Obj *rv;          Tcl_Obj *rv;
48    
49     //Break into cases based on the number of arguments.     //Break into cases based on the number of arguments.
50     if ((objc == 2) && (!strcmp(Tcl_GetString(objv[1]), "-ijutoolsversion")))     if ((objc == 2) && (!strcmp(Tcl_GetString(objv[1]), "-ijutoolsversion")))
51        {        {
52        //Create a string object, initialized to the version number.        //Create a string object, initialized to the version number.
53        rv = Tcl_NewStringObj("v" BUILD_CONFIG_RELEASE_VERSION, -1);        rv = Tcl_NewStringObj("v" BUILD_CONFIG_RELEASE_VERSION, -1);
54    
55        //We have a cleanly allocated object.  Return it to the caller.        //We have a cleanly allocated object.  Return it to the caller.
56        Tcl_SetObjResult(interp, rv);        Tcl_SetObjResult(interp, rv);
57    
58        return(TCL_OK);        return(TCL_OK);
59        }        }
60     else     else
61        {        {
62        Tcl_WrongNumArgs(interp,        Tcl_WrongNumArgs(interp,
63                         1,                         1,
64                         objv,                         objv,
65                         "-ijutoolsversion");                         "-ijutoolsversion");
66    
67        return TCL_ERROR;        return TCL_ERROR;
68        }        }
69     }     }
70    
71    
72  //Performs initial registration to the hash table.  //Performs initial registration to the hash table.
73  //  //
74  void VcinfoInit(Tcl_Interp *interp)  void VcinfoInit(Tcl_Interp *interp)
75  {  {
76     //Register a command named "credits".     //Register a command named "credits".
77     Tcl_CreateObjCommand(interp,     Tcl_CreateObjCommand(interp,
78                              "vcinfo",                              "vcinfo",
79                                                  (Tcl_ObjCmdProc *)VcinfoCmd,                                                  (Tcl_ObjCmdProc *)VcinfoCmd,
80                                                  NULL,                                                  NULL,
81                                                  NULL);                                                  NULL);
82  }  }
83    
84    
85  const char *VcinfoCversion(void)  const char *VcinfoCversion(void)
86  {    {  
87      return ("$Header$");      return ("$Header$");
88  }  }
89    
90    
91  const char *VcinfoHversion(void)  const char *VcinfoHversion(void)
92  {    {  
93      return (VCINFO_H_VERSION);      return (VCINFO_H_VERSION);
94  }  }
95    
96  /* End of vcinfo.c */  /* End of vcinfo.c */

Legend:
Removed from v.68  
changed lines
  Added in v.71

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25