LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-19-2011, 03:12 AM   #1
bhismnarayan
Member
 
Registered: Jul 2010
Location: Jalgaon,India
Distribution: Ubuntu 10.04
Posts: 36

Rep: Reputation: 0
what does #ident does in C program in linux


hello
i want to know what does #ident does in C program in linux.
I m having confusion in this.
 
Old 02-19-2011, 09:44 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,477

Rep: Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020
The #ident is used to provide information about a compiled program or function such as its version, date created or edited and the like. A utility, what, would be used; e.g., what func.o, to display that information. The information is filled-in by a source code management system such as SCCS, RCS or CVS.

For example, you would create a source file with this at the beginning:
Code:
#ident  "$Id$"

/*
 *      Copyright (C) 2000-2011 Your Name
 *
 *      This program is free software; you can redistribute it and/or
 *      modify it under the terms of version 2 of the GNU General
 *      Public License as published by the Free Software Foundation.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *      General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public
 *      License along with this program; if not, write to the Free
 *      Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 *      MA 02111-1307, USA.
*/
/*
 *      Name:           $Source$
 *      Purpose:
 *      Version:        $Revision$
 *      Modified:       $Date$
 *      Author:         Your Name
 *      Date:
 *      $Log$
*/
When a file containing these $token$ strings is placed into, say, CVS, those tokens will be translated into
Code:
#ident  "$Id: histfile.c,v 1.1.1.1 2009/10/07 18:06:40 trona Exp $"

/*
 *      Copyright (C) 2000-2009 Your Name
 *
 *      This program is free software; you can redistribute it and/or
 *      modify it under the terms of version 2 of the GNU General
 *      Public License as published by the Free Software Foundation.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *      General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public
 *      License along with this program; if not, write to the Free
 *      Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 *      MA 02111-1307, USA.
 *
 *      Name:           $Source: /usr/local/cvsroot/utils/histfile.c,v $
 *      Purpose:        display content of a user's .sh_history file
 *      Version:        $Revision: 1.1.1.1 $
 *      Modified:       $Date: 2009/10/07 18:06:40 $
 *      Author:         Your Name
 *      Date:           24 Jun 2009
 *      $Log: histfile.c,v $
 *      Revision 1.1.1.1  2009/10/07 18:06:40  trona
 *      initial installation Slackware 13.0
 *
*/
Of particular interest is the $Log$ token; in a project where code is edited by many hands, every edit is recorded with a comment described what what done, why it was done and when it was done.

Unfortunately, the what utility is not ported to Linux but can be gotten from The Heirloom Project hosted at Sourceforge if you're interested.

Hope this helps some.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Specified ident-reply for different irc-connections or program/process askest Linux - Software 1 12-27-2009 08:29 PM
Problem with Ident oooter Ubuntu 0 08-31-2007 09:51 AM
Ident ftp krisx Linux - Software 2 04-09-2004 06:20 PM
Ident HeLL Linux - Networking 1 08-20-2003 11:23 AM
ident probs Lunake Linux - Newbie 5 08-17-2002 11:29 PM


All times are GMT -5. The time now is 06:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration