Personal tools
User menu

Difference between revisions of "Buildrev"

From Francois Louw

Jump to: navigation, search
 
Line 1: Line 1:
This application is quite handy and small. It is coded in simple C. Every time it runs it reads the given header file and increments the number.
+
[[Projects|Back To All Projects Page]]
  
Please note that this program is very basic, and apart from file checking it does not do any other checking.
+
[[Main Page|Back To Main Page]]
 +
----
 +
[http://aeif.info/files/buildrev/BuildRevision20121120.zip Download Windows executable with source]
  
Usage of the program is
+
This application is quite handy and small. It is coded in simple C. Every time it runs it reads the given header file and increments the build number.
  
<source>
+
Please note that this program is very basic, and apart from file checking it does not do any other checking.
buildrev build.h
+
 
 +
Usage of the program is
 +
<source lang="dos">
 +
buildrev.exe <filename.h>
 
</source>
 
</source>
  
 
The format for the header file is as follows:
 
The format for the header file is as follows:
 
 
<source lang="c">
 
<source lang="c">
 
#define BUILD 1
 
#define BUILD 1
 
</source>
 
</source>
  
The #define and the BUILD is not important and can be changed to <source lang="c">int build= 1</source> if needed.
+
The #define and the BUILD is not important and can be changed to  
 +
<source lang="c">
 +
int build= 1
 +
</source>
  
The code looks for the third field (separated by space) and increases that value.
+
'''The code looks for the third field (separated by space) and increases that value.'''
  
Here is the [http://aeif.info/files/buildrev/buildrev.c code]
+
Here is the code released under the [http://aeif.info/gpl-3.0.txt GPL 3 license]
  
 
<source lang="c">
 
<source lang="c">
Line 48: Line 55:
 
if (f != NULL)
 
if (f != NULL)
 
{
 
{
fscanf(f, "%s %s %d",d, b, &i);
+
fscanf(f, "%s %s %d", d, b, &i);
 
fclose(f);
 
fclose(f);
 
f = NULL;
 
f = NULL;
 
} else
 
} else
 
{
 
{
printf("Build file not found, creating default");
+
printf("Build file not found, creating default\n");
 
strcpy(d, "#define");
 
strcpy(d, "#define");
 
strcpy(b, "BUILD");
 
strcpy(b, "BUILD");
Line 75: Line 82:
 
}
 
}
 
</source>
 
</source>
 +
 +
The code is pretty straightforward and does not need much explanation.
 +
 +
Please read [[Francois_Louw:Copyrights|here]] for more information on copyrights of my projects.

Latest revision as of 06:52, 18 April 2013