unrealircd

- supernets unrealircd source & configuration
git clone git://git.acid.vegas/unrealircd.git
Log | Files | Refs | Archive | README | LICENSE

compilerhelp.c (1135B)

      1 /*
      2  *
      3  * A helper program for the compilation process
      4  *
      5  */
      6 
      7 /* x,y,z,w 
      8  * | | | `-- private build
      9  * | | `---- release build
     10  * | `------ minor version
     11  * `-------- major version
     12  */
     13 
     14 #include <stdio.h>
     15 
     16 void main(int argc,char *argv[])
     17 {
     18 	FILE *openme;
     19 	char inbuf[512];
     20 	int i,pb=0,rb=0,mi=0,ma=0;
     21 
     22 	if (argc == 1)
     23 		exit(-1);
     24 
     25 	if ((openme = fopen(argv[1],"r+"))==NULL)
     26 	{
     27 		printf("error\n");
     28 		exit(-1);
     29 	}
     30 
     31 	fscanf(openme,"%s %s %d\n",inbuf,inbuf,&pb);		/*Read Buffer*/
     32 	fscanf(openme,"%s %s %d\n",inbuf,inbuf,&rb);
     33 	fscanf(openme,"%s %s %d\n",inbuf,inbuf,&mi);
     34 	fscanf(openme,"%s %s %d\n",inbuf,inbuf,&ma);
     35 
     36 	pb++;
     37 	if (argc > 2)
     38 	if (atoi(argv[2])==0)  /*Public Build*/
     39 		rb++;
     40 
     41 	printf("new version = %d,%d,%d,%d",ma,mi,rb,pb);
     42 
     43 	rewind(openme);
     44 
     45 	fprintf(openme,"#define pb %d\n",pb);		/*Write Buffer*/
     46 	fprintf(openme,"#define rb %d\n",rb);
     47 	fprintf(openme,"#define mi %d\n",mi);
     48 	fprintf(openme,"#define ma %d\n",ma);
     49 
     50 	fprintf(openme,"#define vFILEVERSION ma,mi,rb,pb\n#define vPRODUCTVERSION ma,mi,0,0\n#define vDISPFILEVERSION \"%d,%d,%d,%d\\0\"\n#define vSUBBUILD \"%d\\0\"\n",ma,mi,rb,pb,pb);
     51 
     52 	fclose(openme);
     53 
     54 
     55 }