home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!decwrl!csus.edu!netcom.com!aclark
- From: aclark@netcom.com (Al Clark)
- Newsgroups: comp.unix.questions
- Subject: Re: How to add version id into a program?
- Message-ID: <1993Jan25.174954.14758@netcom.com>
- Date: 25 Jan 93 17:49:54 GMT
- References: <1k10nvINNsnr@function.mps.ohio-state.edu>
- Organization: Self
- Lines: 36
-
- In article <1k10nvINNsnr@function.mps.ohio-state.edu> ren@math.ohio-state.edu (Liming Ren) writes:
- >I don't know what we need to do in C source code to have
- >version (unix command) to report version id.
- >
- [ man info deleted ]
- >I put lines such as
- >
- >/*@(#)RELEASE 1.0*/ or
- >
- >#define version_id "@(#)RELEASE 1.0"
- >
- >in my source program. Version does not work with this.
- >
- >Please help!
- >Many thanks!
-
- You need to put the string in the object file, thence the
- executable. Your inputs did not do that. The string only
- existed in the source file.
- Use, for example:
- char version_id[]="@(#)RELEASE 1.0";
-
- However, note that if you try to link multiple objects with
- this declaration, you have multiple declarations, so declare
- the variable as static.
- static char version_id[]="@(#)RELEASE 1.0";
- Thus you can even put such strings in header files that are
- included more than once in a program.
-
- Note that the 'what' command of SCCS uses the string you
- are talking of, and that SCCS will put it in and update it.
- Also, RCS has a similar 'ident' feature, using a different
- string structure. This last paragraph is to save people
- the trouble of adding this info. :)
- --
- Al - aclark@netcom.com - My opinions are my own.
-