Diff for /embedaddon/miniupnpc/wingenminiupnpcstrings.c between versions 1.1.1.1 and 1.1.1.3

version 1.1.1.1, 2012/02/21 23:16:22 version 1.1.1.3, 2023/09/27 11:21:37
Line 1 Line 1
 /* $Id$ */  /* $Id$ */
 /* Project: miniupnp  /* Project: miniupnp
 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
  * Author: Thomas Bernard   * Author: Thomas Bernard
 * Copyright (c) 2005-2009 Thomas Bernard * Copyright (c) 2005-2021 Thomas Bernard
  * This software is subjects to the conditions detailed   * This software is subjects to the conditions detailed
  * in the LICENSE file provided within this distribution */   * in the LICENSE file provided within this distribution */
 #include <stdio.h>  #include <stdio.h>
Line 26  int main(int argc, char * * argv) { Line 26  int main(int argc, char * * argv) {
      dwBuildNumber :       dwBuildNumber :
        The build number of the operating system.         The build number of the operating system.
      dwPlatformId       dwPlatformId
       The operating system platform. This member can be the following value.        The operating system platform. This member can be the following value.
      szCSDVersion       szCSDVersion
        A null-terminated string, such as "Service Pack 3", that indicates the         A null-terminated string, such as "Service Pack 3", that indicates the
        latest Service Pack installed on the system. If no Service Pack has         latest Service Pack installed on the system. If no Service Pack has
Line 44  int main(int argc, char * * argv) { Line 44  int main(int argc, char * * argv) {
         fin = fopen("VERSION", "r");          fin = fopen("VERSION", "r");
         fgets(miniupnpcVersion, sizeof(miniupnpcVersion), fin);          fgets(miniupnpcVersion, sizeof(miniupnpcVersion), fin);
         fclose(fin);          fclose(fin);
        for(n = 0; n < sizeof(miniupnpcVersion); n++) {        for(n = 0; n < (int)sizeof(miniupnpcVersion); n++) {
                 if(miniupnpcVersion[n] < ' ')                  if(miniupnpcVersion[n] < ' ')
                         miniupnpcVersion[n] = '\0';                          miniupnpcVersion[n] = '\0';
         }          }
Line 59  int main(int argc, char * * argv) { Line 59  int main(int argc, char * * argv) {
                 fout = fopen(argv[2], "w");                  fout = fopen(argv[2], "w");
                 if(!fout) {                  if(!fout) {
                         fprintf(stderr, "Cannot open %s for writing.\n", argv[2]);                          fprintf(stderr, "Cannot open %s for writing.\n", argv[2]);
                           fclose(fin);
                         return 1;                          return 1;
                 }                  }
                 n = 0;                  n = 0;
Line 77  int main(int argc, char * * argv) { Line 78  int main(int argc, char * * argv) {
                 fclose(fin);                  fclose(fin);
                 fclose(fout);                  fclose(fout);
                 printf("%d lines written to %s.\n", n, argv[2]);                  printf("%d lines written to %s.\n", n, argv[2]);
           }
           if(argc >= 4) {
                   fout = fopen(argv[3], "w");
                   if(fout == NULL) {
                           fprintf(stderr, "Cannot open %s for writing.\n", argv[2]);
                           return 1;
                   } else {
                           char * cur, * next;
                           fprintf(fout, "#define LIBMINIUPNPC_DOTTED_VERSION \"%s\"\n", miniupnpcVersion);
                           next = strchr(miniupnpcVersion, '.');
                           if (next && *next) {
                                   *next = '\0';
                                   next++;
                           }
                           fprintf(fout, "#define LIBMINIUPNPC_MAJOR_VERSION %s\n", miniupnpcVersion);
                           cur = next;
                           next = strchr(cur, '.');
                           if (next && *next) {
                                   *next = '\0';
                                   next++;
                           }
                           fprintf(fout, "#define LIBMINIUPNPC_MINOR_VERSION %s\n", cur);
                           cur = next;
                           next = strchr(cur, '.');
                           if (next && *next) {
                                   *next = '\0';
                                   next++;
                           }
                           fprintf(fout, "#define LIBMINIUPNPC_MICRO_VERSION %s\n", cur);
                           fclose(fout);
                           printf("%s written\n", argv[3]);
                   }
         }          }
   return 0;    return 0;
 }  }

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>