home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / question / 15924 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  1.6 KB

  1. Path: sparky!uunet!olivea!decwrl!csus.edu!netcom.com!aclark
  2. From: aclark@netcom.com (Al Clark)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: How to add version id into a program?
  5. Message-ID: <1993Jan25.174954.14758@netcom.com>
  6. Date: 25 Jan 93 17:49:54 GMT
  7. References: <1k10nvINNsnr@function.mps.ohio-state.edu>
  8. Organization: Self
  9. Lines: 36
  10.  
  11. In article <1k10nvINNsnr@function.mps.ohio-state.edu> ren@math.ohio-state.edu (Liming Ren) writes:
  12. >I don't know what we need to do in C source code to have 
  13. >version (unix command) to report version id.
  14. >
  15.    [ man info deleted ]
  16. >I put  lines such as
  17. >
  18. >/*@(#)RELEASE 1.0*/  or
  19. >
  20. >#define version_id "@(#)RELEASE 1.0"
  21. >
  22. >in my source program. Version does not work with this.
  23. >
  24. >Please help!
  25. >Many thanks!
  26.  
  27.     You need to put the string in the object file, thence the 
  28.     executable.  Your inputs did not do that. The string only
  29.     existed in the source file.
  30.     Use, for example:
  31.     char version_id[]="@(#)RELEASE 1.0";
  32.  
  33.     However, note that if you try to link multiple objects with
  34.     this declaration, you have multiple declarations, so declare
  35.     the variable as static.
  36.     static char version_id[]="@(#)RELEASE 1.0";
  37.     Thus you can even put such strings in header files that are
  38.     included more than once in a program.
  39.  
  40.     Note that the 'what' command of SCCS uses the string you
  41.     are talking of, and that SCCS will put it in and update it.
  42.     Also, RCS has a similar 'ident' feature, using a different
  43.     string structure.  This last paragraph is to save people
  44.     the trouble of adding this info.  :)
  45. -- 
  46. Al - aclark@netcom.com - My opinions are my own.
  47.