home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / question / 15929 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.7 KB  |  54 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!gatech!rpi!utcsri!newsflash.concordia.ca!hobbit.ireq.hydro.qc.ca!shamel
  3. From: shamel@mais.hydro.qc.ca (Stephane Hamel)
  4. Subject: Re: How to add version id into a program?
  5. Message-ID: <shamel.727987356@tdsb-s>
  6. Sender: news@ireq.hydro.qc.ca (Netnews Admin)
  7. Organization: Hydro-Quebec (DSB)
  8. References: <1k10nvINNsnr@function.mps.ohio-state.edu>
  9. Date: Mon, 25 Jan 1993 18:42:36 GMT
  10. Lines: 42
  11.  
  12. ren@math.ohio-state.edu (Liming Ren) writes:
  13.  
  14. >I don't know what we need to do in C source code to have 
  15. >version (unix command) to report version id.
  16.  
  17. >I checked  man version: It says 
  18.  
  19. >The version command looks for the ASCII string of characters
  20. >following the string "@(#)RELEASE ". The string could be any
  21. >sequence of printable characters terminated by a NEWLINE  or
  22. >NULL.   Thus  if  you  put  this string into your files, the
  23. >version command can be used to display the version  of  your
  24.  
  25. >I put  lines such as
  26.  
  27. >/*@(#)RELEASE 1.0*/  or
  28.  
  29. >#define version_id "@(#)RELEASE 1.0"
  30.  
  31. >in my source program. Version does not work with this.
  32.  
  33. >Please help!
  34. >Many thanks!
  35.  
  36. Usually, that kind of identification can be put in a C program using
  37. something like:
  38.  
  39. #ifndef lint
  40. static char *Id = "@(#)RELEASE 1.0";
  41. #endif
  42.  
  43. Many revision control programs (like SCCS(1)) can automatically keep
  44. track of versions and keep an appropriate id string in your source program.
  45. The string must end up in the compiled program, thus only #define'ing it
  46. will not help. Depending on wich Unix you are, the command to show an
  47. ID string will be: ident(1) or version(1).
  48.  
  49. Hope this helped!
  50. --
  51.  Stephane Hamel (SHamel@Mais.Hydro.Qc.Ca) | AutoControl Inc.
  52.  Senior Programmer-Analyst                | Montreal, Quebec, Canada
  53.