home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!gatech!rpi!utcsri!newsflash.concordia.ca!hobbit.ireq.hydro.qc.ca!shamel
- From: shamel@mais.hydro.qc.ca (Stephane Hamel)
- Subject: Re: How to add version id into a program?
- Message-ID: <shamel.727987356@tdsb-s>
- Sender: news@ireq.hydro.qc.ca (Netnews Admin)
- Organization: Hydro-Quebec (DSB)
- References: <1k10nvINNsnr@function.mps.ohio-state.edu>
- Date: Mon, 25 Jan 1993 18:42:36 GMT
- Lines: 42
-
- 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.
-
- >I checked man version: It says
-
- >The version command looks for the ASCII string of characters
- >following the string "@(#)RELEASE ". The string could be any
- >sequence of printable characters terminated by a NEWLINE or
- >NULL. Thus if you put this string into your files, the
- >version command can be used to display the version of your
-
- >
- >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!
-
- Usually, that kind of identification can be put in a C program using
- something like:
-
- #ifndef lint
- static char *Id = "@(#)RELEASE 1.0";
- #endif
-
- Many revision control programs (like SCCS(1)) can automatically keep
- track of versions and keep an appropriate id string in your source program.
- The string must end up in the compiled program, thus only #define'ing it
- will not help. Depending on wich Unix you are, the command to show an
- ID string will be: ident(1) or version(1).
-
- Hope this helped!
- --
- Stephane Hamel (SHamel@Mais.Hydro.Qc.Ca) | AutoControl Inc.
- Senior Programmer-Analyst | Montreal, Quebec, Canada
-