#include "win_register.cpp"

void main(int argc, char *argv[], char *envp[])
{
   char     *uszInString;
   char     *uszFirstName;
   char     *uszKey;
   FILE     *stream;

   setbuf(stdout,0);

   uszInString  = (char*) calloc(1,255);
   uszFirstName = (char*) calloc(1,255);

   if (argc < 2)
   {
     printf("win_reg_generate USAGE : win_reg_generate <OUTFILE>\n");
     return;
   }

   printf("Enter Name : ");
   gets(uszInString);

   uszKey = GenRegString(uszInString);

   printf(uszKey);


   stream = fopen(argv[1],"w+");

   strncpy(uszFirstName,uszInString,(strcspn(uszInString," ")));

   fprintf(stream,"Hi %s\n",uszFirstName );
   fprintf(stream,"\n");
   fprintf(stream,"Thank you for registering Bandit Tagger for Win32 version 1.27+\n");
   fprintf(stream,"\n");
   fprintf(stream,"Enter your name and key exactly as stated below.\n");
   fprintf(stream,"\n");
   fprintf(stream,"Name : ");
   fprintf(stream,uszInString);
   fprintf(stream,"\nKey  : ");
   fprintf(stream,uszKey);
   fprintf(stream,"\n");
   fprintf(stream,"\n");
   fprintf(stream,"For help, support or ideas please contact us at\n");
   fprintf(stream,"email : bregnvig@stealthmail.com\n");
   fprintf(stream,"\nUse Subject \"subscribe\" for automatically getting updates\n");
   fprintf(stream,"and newsletters from us.");
   fprintf(stream,"\n\n");

   fclose(stream);

   return;
}
