All pastes #595793 Raw Edit

Unnamed

public text v1 · immutable
#595793 ·published 2007-06-29 17:41 UTC
rendered paste body
#include "stdafx.h"
int _tmain()
{
    FILE *inp = fopen("./.svn/entries", "r");
    if (!inp) return 1;
    FILE *out = fopen("MangosRevision.h","w");
    if (!out) return 1;
      
    char revision[6];
    fgets(revision,sizeof(revision),inp);
    fgets(revision,sizeof(revision),inp);
    fgets(revision,sizeof(revision),inp);
    fgets(revision,sizeof(revision),inp);

    fprintf(out,"/*\n"); 
    fprintf(out,"* Copyright (C) 2005,2006,2007 MaNGOS <http://www.mangosproject.org/>\n");
    fprintf(out,"*\n");
    fprintf(out,"* This program is free software; you can redistribute it and/or modify\n");
    fprintf(out,"* it under the terms of the GNU General Public License as published by\n");
    fprintf(out,"* the Free Software Foundation; either version 2 of the License, or\n");
    fprintf(out,"* (at your option) any later version.\n");
    fprintf(out,"*\n");
    fprintf(out,"* This program is distributed in the hope that it will be useful,\n");
    fprintf(out,"* but WITHOUT ANY WARRANTY; without even the implied warranty of\n");
    fprintf(out,"* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n");
    fprintf(out,"* GNU General Public License for more details.\n");
    fprintf(out,"*\n");
    fprintf(out,"* You should have received a copy of the GNU General Public License\n");
    fprintf(out,"* along with this program; if not, write to the Free Software\n");
    fprintf(out,"* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n");
    fprintf(out,"*/\n");
    fprintf(out,"\n");
    fprintf(out,"#define MANGOS_SVN_REVISION  %s \n",revision);
    fprintf(out,"\n");

    fclose(out);
    fclose(inp);
    return 0;
}