#include "register.cpp"
#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("reg_generate USAGE : reg_generate <OUTFILE>\n");
     return;
   }

   printf("Indtast Navn : ");
   gets(uszInString);

   uszKey = GenRegString(uszInString);

   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 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,"\nOS/2  Key : ");
   fprintf(stream,uszKey);
   fprintf(stream,"\n");

   uszKey = win_GenRegString(uszInString);
   fprintf(stream,  "Win32 Key : ");
   fprintf(stream,uszKey);
   fprintf(stream," - Bandit suite for Win32 available when PMMAIL98 is released.\n");
   fprintf(stream,"\n");
   fprintf(stream,"For help, support or ideas please contact us at\n");
   fprintf(stream,"email : fa-partners@usa.net\n");
   fprintf(stream,"\nUse Subject \"subscribe\" for automatically getting updates\n");
   fprintf(stream,"and newsletters from us.");
   fprintf(stream,"\n\n");

   fclose(stream);
  
   printf("Done !!\n");
   return;
}
