CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

embed subversion number in code as a string

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mds



Joined: 06 Nov 2005
Posts: 29

View user's profile Send private message

embed subversion number in code as a string
PostPosted: Mon Feb 21, 2011 7:55 pm     Reply with quote

HI,
A little new to subversion and such. I'm trying to embed the subversion commit number as a string in my ccs code.

Code:
#define ver_str "v2.00"

this snip is what I have been using and manually updating.

subversion recognises keywords
$Revision$ placed in a text file for example is replaced with
$Revision 17$ after a commit. 17 being the 17th commit in this eg.

so I tried
Code:
#define ver_str "$Revision$"

This, as expected, gets replaced with
Code:
#define ver_str "$Revision: 17"
after a commit

I would like to remove the text word Revision. Thus rendering ver_str as "17" ie only the number part.

any ideas?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 22, 2011 1:38 pm     Reply with quote

Quote:
subversion recognises keywords

Is this statement from a CCS manual or User's Guide ? Post a link to it.

Quote:
after a commit

What's a commit ? Does it mean 'compiled' ? Or 'programmed' ?


I have the feeling that you're using some product other than CCS
and it has its own documentation that we haven't seen.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Feb 22, 2011 4:59 pm     Reply with quote

The post is expecting basic knowledge of subversion, a free/open source version control system. See http://subversion.apache.org
mds



Joined: 06 Nov 2005
Posts: 29

View user's profile Send private message

PostPosted: Tue Feb 22, 2011 9:12 pm     Reply with quote

Yes my mistake. I was expecting prior knowledge of subversion. I anticipated that most coders would be using something similar?

With multiple projects and release versions we are beginning to have problems with bug and issue tracking. I'm looking at automated systems.

My question was whether CCS could somehow parse or deal with such things.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Feb 23, 2011 12:16 am     Reply with quote

I didn't exactly understand, where you want to use the information from the version string. Inside the application code? It should work with C string processing and thus consume resources at run-time. The CCS C preprocessor doesn't have the features to perform text processing.
mds



Joined: 06 Nov 2005
Posts: 29

View user's profile Send private message

PostPosted: Wed Feb 23, 2011 6:08 pm     Reply with quote

HI,
Yes, in the application code.
for eg Somewhere in the code I would have this.
Code:
printf("%s",ver_str);


Your last sentence pretty much kills the idea tho:( If the pre-processor has no provision for processing such things I'll have to resort to manual labour :(
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group