Ignore:
Timestamp:
Oct 1, 2023, 4:30:02 PM (23 months ago)
Author:
erdmann
Message:

merging v2.9 into v2.9_Lars branch, in particular, this means adding french,spanish,russian translations

Location:
branches/v2.9_Lars
Files:
5 edited
11 copied

Legend:

Unmodified
Added
Removed
  • branches/v2.9_Lars

  • branches/v2.9_Lars/mediafolder/c/cddb/cddb.cpp

    r40 r91  
    8888    delete(tempTrack);
    8989  }
    90  
     90
    9191  if(nextCddb)delete nextCddb;
    9292
     
    129129  if(tempTrack) {
    130130    /* Yes, add  the rest of the title to that what we already have */
    131     strncat(tempTrack->trackname, track->trackname, sizeof(tempTrack->trackname)-strlen(tempTrack->trackname)-1);   
     131    strncat(tempTrack->trackname, track->trackname, sizeof(tempTrack->trackname)-strlen(tempTrack->trackname)-1);
    132132    delete(track);
    133133    return;
     
    136136  tempTrack=firstTrack;
    137137  while(tempTrack->nextTrack) {
    138     tempTrack=tempTrack->nextTrack; 
     138    tempTrack=tempTrack->nextTrack;
    139139  }
    140140  tempTrack->nextTrack=track;
    141   return; 
     141  return;
    142142}
    143143
     
    152152      return tempTrack;
    153153
    154     tempTrack=tempTrack->nextTrack; 
     154    tempTrack=tempTrack->nextTrack;
    155155  }
    156156
     
    169169
    170170#if 0
    171 /* now defined in printHelper.cpp 
     171/* now defined in printHelper.cpp
    172172   or cddbhelper.cpp. By choosing the right module to link to, it's possible
    173173   to redirect the messages without changing this module. Used for different
     
    191191  fileHandle=open("cddb.out",O_APPEND|O_TEXT|O_WRONLY);
    192192  if(fileHandle==-1) {
    193     printError("Cannot open cddb.out");
     193    printError((char *)"Cannot open cddb.out");
    194194    return;
    195195  }
     
    205205
    206206int readResponse(int s, char * buffer,int size)
    207 { 
     207{
    208208  int a;
    209209  int rc;
    210  
     210
    211211  rc=1;
    212212  for(a=0;a<size&&rc>0;a++) {
     
    217217    }
    218218    if(rc==-1)
    219       return CDDB_ERROR;   
    220   }
    221    
     219      return CDDB_ERROR;
     220  }
     221
    222222  return CDDB_ERROR;
    223223}
     
    237237    case '3': return CDDB_MORE;
    238238    case '4':
    239       printError("CDDB server error");
     239      printError((char *)"CDDB server error");
    240240      return CDDB_ERROR;
    241241    case '5':
    242       printError("CDDB client error");
     242      printError((char *)"CDDB client error");
    243243      return CDDB_ERROR;
    244244    default:
    245       printError("Unknown error");
     245      printError((char *)"Unknown error");
    246246      break;
    247247    }
     
    258258  /* Handshaking */
    259259  if(verbose)
    260     printError("Handshaking...    ");
     260    printError((char *)"Handshaking...    ");
    261261  sprintf(buffer,"cddb hello %s %s %s %s\n",username,hostname,clientname,version);
    262   if(verbose==2) 
     262  if(verbose==2)
    263263    printError(buffer);
    264264  rc=write(s,buffer,strlen(buffer));
    265265  if(rc==-1) {
    266     printError("Handshaking: cannot write to CDDB server");
    267     return -1;
    268   }
    269   if(verbose)
    270     printError("done\n");
    271   if(verbose==2)
    272     printError("Response: ");
    273  
     266    printError((char *)"Handshaking: cannot write to CDDB server");
     267    return -1;
     268  }
     269  if(verbose)
     270    printError((char *)"done\n");
     271  if(verbose==2)
     272    printError((char *)"Response: ");
     273
    274274  rc=readResponse(s,buffer,sizeof(buffer));
    275275  if(rc==CDDB_ERROR) {
    276     printError("Handshaking: cannot get response");
    277     return -1;
    278   }
    279   if(verbose==2) 
     276    printError((char *)"Handshaking: cannot get response");
     277    return -1;
     278  }
     279  if(verbose==2)
    280280    printErrorCR(buffer);
    281  
     281
    282282  if(check_cddb_code(buffer)==CDDB_ERROR)
    283283    return -1;
     
    297297  do {
    298298    if(verbose)
    299       printError("\nSetting protocol level...    ");
     299      printError((char *)"\nSetting protocol level...    ");
    300300    sprintf(buffer,"proto %d\n",iProtLevel);
    301301    printError(buffer);
    302302    rc=write(s,buffer,strlen(buffer));
    303303    if(rc==-1) {
    304       printError("Protocol: cannot write to CDDB server");
     304      printError((char *)"Protocol: cannot write to CDDB server");
    305305      return -1;
    306306    }
    307307    if(verbose)
    308       printError("done\n");
     308      printError((char *)"done\n");
    309309    if(verbose==2)
    310       printError("Response: ");
    311    
     310      printError((char *)"Response: ");
     311
    312312    rc=readResponse(s,buffer,sizeof(buffer));
    313313    if(rc==CDDB_ERROR) {
    314       printError("Set protocol: cannot get response");
     314      printError((char *)"Set protocol: cannot get response");
    315315      return -1;
    316316    }
    317317    if(verbose==2)
    318318      printErrorCR(buffer);
    319    
     319
    320320    /* Check cddb code */
    321321    if(check_cddb_code(buffer)==CDDB_ERROR) {
     
    326326      break;
    327327    /* protocol not supported. Decrement level and try again. */
    328     iProtLevel--;     
     328    iProtLevel--;
    329329  }while(iProtLevel>0);
    330  
     330
    331331  return 0;
    332332}
     
    343343  do {
    344344    rc=readResponse(s,buffer,sizeof(buffer)); /* Get next line */
    345    
     345
    346346    if(rc==CDDB_ERROR)
    347347      return root; /* return what we have so far */
     
    351351
    352352    /* A new cddb instance for every match */
    353     Cddb=new cddb("","","",1); /* One fuzzy match or one of several matches */
     353    Cddb=new cddb((char *)"",(char *)"",(char *)"",1); /* One fuzzy match or one of several matches */
    354354    /* Get the data for this match */
    355355    sscanf(buffer, " %20s %x %100[^/\r\n] / %100[^\r\n]", Cddb->category,&Cddb->discid,Cddb->artist,Cddb->title);
     
    359359    else
    360360      root->linkCddb(Cddb);
    361    
     361
    362362  }while(true);
    363363
     
    383383  /* Sending query */
    384384  if(verbose)
    385     printError("Sending query cmd...    ");
     385    printError((char *)"Sending query cmd...    ");
    386386  /* Build cmd-line */
    387387  sprintf(buffer,"cddb query %08x %d",cddbInfo->discid,cddbInfo->numTracks);
     
    389389    rc=snprintf(track,sizeof(track)," %d",cddbInfo->startSector[a]);
    390390    if(rc==EOF||rc>=sizeof(track)) {
    391       printError("Query: buffer overrun while formatting track offsets.\nPlease report this bug.\n");
     391      printError((char *)"Query: buffer overrun while formatting track offsets.\nPlease report this bug.\n");
    392392      return 0;
    393393    }
    394394    if(sizeof(buffer)-strlen(buffer) <= strlen(track)) {
    395       printError("Query: buffer overrun while adding track offsets to command.\nPlease report this bug.\n");
     395      printError((char *)"Query: buffer overrun while adding track offsets to command.\nPlease report this bug.\n");
    396396      return 0;
    397397    }
     
    401401  rc=snprintf(track,sizeof(track), " %d\n",cddbInfo->discLength);
    402402  if(rc==EOF||rc>=sizeof(track)) {
    403     printError("Query: buffer overrun while formatting disclength.\nPlease report this bug.\n");
     403    printError((char *)"Query: buffer overrun while formatting disclength.\nPlease report this bug.\n");
    404404    return 0;
    405405  }
    406406  if(sizeof(buffer)-strlen(buffer) <= strlen(track)) {
    407     printError("Query: buffer overrun while adding disclength to command.\nPlease report this bug.\n");
     407    printError((char *)"Query: buffer overrun while adding disclength to command.\nPlease report this bug.\n");
    408408    return 0;
    409409  }
     
    415415  rc=write(s,buffer,strlen(buffer));
    416416  if(rc==-1) {
    417     printError("Query: cannot write to CDDB server");
     417    printError((char *)"Query: cannot write to CDDB server");
    418418    return 0;
    419419  }
    420420  if(verbose)
    421     printError(" done\n");
    422   if(verbose==2)
    423     printError("Response: ");
    424  
     421    printError((char *)" done\n");
     422  if(verbose==2)
     423    printError((char *)"Response: ");
     424
    425425  rc=readResponse(s,buffer,sizeof(buffer));
    426426  //rc=read(s,buffer,sizeof(buffer)-1);
    427427  if(rc==CDDB_ERROR) {
    428     printError("Query: cannot get response");
     428    printError((char *)"Query: cannot get response");
    429429    return 0;
    430430  }
     
    440440    {
    441441    case 200:  /* exact match */
    442       Cddb=new cddb("","","");
     442      Cddb=new cddb((char *)"",(char *)"",(char *)"");
    443443
    444444      sscanf(buffer+4, "%20s %x %100[^/\r\n] / %100[^\r\n]", Cddb->category,&Cddb->discid,Cddb->artist,Cddb->title);
     
    457457  /* We shouldn't reach this */
    458458  return 0;
    459 } 
     459}
    460460
    461461/* Reads the CDDB banner from the server after connecting */
     
    471471  rc=readResponse(s,buffer,sizeof(buffer));
    472472  if(rc==CDDB_ERROR) {
    473     printError("Cannot read CDDB-Banner");
     473    printError((char *)"Cannot read CDDB-Banner");
    474474    return -1;
    475475  }
     
    493493  int iTrack=0;
    494494  int iTemp=0;
    495  
     495
    496496  do{
    497497    rc=readResponse(s,buffer,sizeof(buffer));
    498498    if(rc==CDDB_ERROR) {
    499       printError("Read request: cannot get response");
     499      printError((char *)"Read request: cannot get response");
    500500      return CDDB_ERROR;
    501501    }
     
    504504    if(buffer[0]!='.')
    505505      printData(buffer);
    506    
     506
    507507    if(buffer[0]=='#') /* This is a comment */
    508508      { }
     
    511511      if(buffer[0]=='.') /* End of data */
    512512        return CDDB_OK; /* Done */
    513      
     513
    514514      //printf("Found data: %s\n",buffer);
    515515      sscanf(buffer,"%20[^0-9=]",key);
     
    524524  }while(rc==CDDB_MORE);
    525525
     526  return CDDB_OK;
    526527}
    527528
     
    534535
    535536  /* Build cmd-line */
    536   sprintf(buffer,"cddb read %s %08x\n",Cddb->category,Cddb->discid); 
    537   if(verbose) 
    538     printError("\nSending read cmd... ");
     537  sprintf(buffer,"cddb read %s %08x\n",Cddb->category,Cddb->discid);
     538  if(verbose)
     539    printError((char *)"\nSending read cmd... ");
    539540  if(verbose==2)
    540541    printError(buffer);
    541  
     542
    542543  rc=write(s,buffer,strlen(buffer));
    543544  if(rc==-1) {
    544     printError("Read request: cannot write to CDDB server");
    545     return -1;
    546   }
    547   if(verbose) 
    548     printError("done\n");
    549   if(verbose==2)
    550     printError("Response: ");
    551  
     545    printError((char *)"Read request: cannot write to CDDB server");
     546    return -1;
     547  }
     548  if(verbose)
     549    printError((char *)"done\n");
     550  if(verbose==2)
     551    printError((char *)"Response: ");
     552
    552553  rc=readResponse(s,buffer,sizeof(buffer));
    553554  if(rc==CDDB_ERROR) {
    554     printError("Read request: cannot get response");
    555     return -1;
    556   }
    557   if(verbose==2) 
     555    printError((char *)"Read request: cannot get response");
     556    return -1;
     557  }
     558  if(verbose==2)
    558559    printError(buffer);
    559560  if(check_cddb_code(buffer)==CDDB_ERROR)
    560561    return CDDB_ERROR;
    561562
    562   /* Get the data */ 
     563  /* Get the data */
    563564  read_and_parse(s,Cddb);
    564   return CDDB_OK; 
     565  return CDDB_OK;
    565566}
    566567
     
    577578  /* Creating socket */
    578579  if(verbose)
    579     printError("Creating socket...     ");
     580    printError((char *)"Creating socket...     ");
    580581  s=socket(AF_INET,SOCK_STREAM,0);
    581582  if(s==-1) {
    582     printError("Cannot create socket!");
     583    printError((char *)"Cannot create socket!");
    583584    return -1;
    584585  }
    585586  *skt=s;
    586587  if(verbose)
    587     printError("Socket created\n");
     588    printError((char *)"Socket created\n");
    588589
    589590  /* Querying host */
    590591  if(verbose)
    591     printError("Querying host...     ");
     592    printError((char *)"Querying host...     ");
    592593  he = gethostbyname(host);
    593594  if(he==NULL) {
    594     printError("Cannot get host address.\ngethostbyname() returned error:  ");
     595    printError((char *)"Cannot get host address.\ngethostbyname() returned error:  ");
    595596    switch (h_errno)
    596597      {
    597598      case HOST_NOT_FOUND:
    598         printError("Host not found\n");
     599        printError((char *)"Host not found\n");
    599600        break;
    600601      case TRY_AGAIN:
    601         printError("Temporary error. Try again later.\n");
     602        printError((char *)"Temporary error. Try again later.\n");
    602603        break;
    603604      case NO_DATA:
    604         printError("Name valid but name server has no associated address.\n");
     605        printError((char *)"Name valid but name server has no associated address.\n");
    605606        break;
    606607      case NO_RECOVERY:
    607         printError("Unrecoverable error.\n");
     608        printError((char *)"Unrecoverable error.\n");
    608609        break;
    609610      default:
    610         printError("Unknown error\n");
     611        printError((char *)"Unknown error\n");
    611612      }
    612613    /* Close the socket */
    613614    close(s);
    614615    return -1;
    615   }   
    616 
    617   if(verbose)
    618     printError("Host found.\n");
     616  }
     617
     618  if(verbose)
     619    printError((char *)"Host found.\n");
    619620
    620621
    621622  /* Connecting to host */
    622623  if(verbose)
    623     printError("Connecting to host...    ");
     624    printError((char *)"Connecting to host...    ");
    624625  memset(&sa_in,0, sizeof(struct sockaddr_in));
    625626
     
    634635      {
    635636      case EBADF:
    636         printError("No valid socket descriptor");
     637        printError((char *)"No valid socket descriptor");
    637638        break;
    638639      case EISCONN:
    639         printError("The socket is already connected\n");
     640        printError((char *)"The socket is already connected\n");
    640641        break;
    641642      case ETIMEDOUT:
    642         printError("No connection. Timed out.\n");
     643        printError((char *)"No connection. Timed out.\n");
    643644        break;
    644645      case ECONNREFUSED:
    645         printError("Connection refused by  host.\n");
     646        printError((char *)"Connection refused by  host.\n");
    646647        break;
    647648      case EADDRNOTAVAIL:
    648         printError("Address not avaiable.\n");
     649        printError((char *)"Address not avaiable.\n");
    649650        break;
    650651
    651652      default:
    652         printError("General failure: Cannot connect to host\n");
     653        printError((char *)"General failure: Cannot connect to host\n");
    653654      }
    654655    close(s);
     
    656657  }
    657658  if(verbose)
    658     printError("connected.\n");
     659    printError((char *)"connected.\n");
    659660  return 0;
    660661}
  • branches/v2.9_Lars/mediafolder/c/cddb/printhelper.cpp

    r2 r91  
    3030 */
    3131
    32 void extern printError(char* errorString)
     32void printError(char* errorString)
    3333{
    3434  fprintf(stderr,"%s",errorString);
    3535}
    3636
    37 void extern printErrorCR(char* errorString)
     37void printErrorCR(char* errorString)
    3838{
    3939  fprintf(stderr,"%s\n",errorString);
     
    4141
    4242
    43 void extern printData(char* outString)
     43void printData(char* outString)
    4444{
    4545  int fileHandle;
  • branches/v2.9_Lars/mediafolder/c/cddb/res/makefile

    r53 r91  
    1313
    1414CPPFILES        =
    15 all:     pmcddb001.dll pmcddb049.dll pmcddb031.dll pmcddb039.dll pmcddb088.dll
     15all:     pmcddb001.dll pmcddb049.dll pmcddb031.dll pmcddb039.dll pmcddb088.dll pmcddb033.dll pmcddb034.dll
    1616
    1717
     
    2929                gcc -Zdll -Zomf -I$(INC) pmcddb049.c pmcddb049.def
    3030                rc pmcddb049.res pmcddb049.dll
    31 #               icc $(CPPFLAGS) -I$(INC) pmcddb001.c pmcddb04á.def
    3231
    3332pmcddb049.res:  pmcddb049.rc pmcddb049.dlg $(INC)\pmcddbres.h
     
    3736                gcc -Zdll -Zomf -I$(INC) pmcddb031.c pmcddb031.def
    3837                rc pmcddb031.res pmcddb031.dll
    39 #               icc $(CPPFLAGS) -I$(INC) pmcddb001.c pmcddb04á.def
    4038
    4139pmcddb031.res:  pmcddb031.rc pmcddb031.dlg $(INC)\pmcddbres.h
     
    4543                gcc -Zdll -Zomf -I$(INC) pmcddb039.c pmcddb039.def
    4644                rc pmcddb039.res pmcddb039.dll
    47 #               icc $(CPPFLAGS) -I$(INC) pmcddb001.c pmcddb04á.def
    4845
    4946pmcddb039.res:  pmcddb039.rc pmcddb039.dlg $(INC)\pmcddbres.h
     
    5754                rc  -i $(INC) -r pmcddb088.rc
    5855
     56pmcddb033.dll:  pmcddb033.c pmcddb033.res
     57                gcc -Zdll -Zomf -I$(INC) pmcddb033.c pmcddb033.def
     58                rc pmcddb033.res pmcddb033.dll
     59
     60pmcddb033.res:  pmcddb033.rc pmcddb033.dlg $(INC)\pmcddbres.h
     61                rc  -i $(INC) -r pmcddb033.rc
     62
     63pmcddb034.dll:  pmcddb034.c pmcddb034.res
     64                gcc -Zdll -Zomf -I$(INC) pmcddb034.c pmcddb034.def
     65                rc pmcddb034.res pmcddb034.dll
     66
     67pmcddb034.res:  pmcddb034.rc pmcddb034.dlg $(INC)\pmcddbres.h
     68                rc  -i $(INC) -r pmcddb034.rc
     69
    5970clean:
    6071        -rm *.obj
     
    6475cleaner:
    6576        -rm *.*~
    66 
    67        
    68 
  • branches/v2.9_Lars/mediafolder/c/cddb/res/pmcddb007.DEF

    r90 r91  
    1919; */
    2020
    21 LIBRARY PMDB001 INITGLOBAL
     21LIBRARY PMDB007 INITINSTANCE TERMINSTANCE
    2222DESCRIPTION '$@#(c) Chris Wohlgemuth :0.1 (12.05.02) (PMDB001.DLL)#@##1## 12.05.2002 18:17:00      ;-)  ::::1::@@Resource-DLL'
    23 PROTMODE
    24 CODE LOADONCALL DISCARDABLE
    25 DATA SINGLE SHARED DISCARDABLE
    26 EXPORTS 
    27         queryLanguage
     23DATA MULTIPLE NONSHARED
     24EXPORTS
     25      queryLanguage = _queryLanguage
    2826
  • branches/v2.9_Lars/mediafolder/c/cddb/res/pmcddb033.DEF

    r90 r91  
    2222;  */
    2323
    24 LIBRARY PMDB033 INITGLOBAL
     24LIBRARY PMDB033 INITINSTANCE TERMINSTANCE
    2525DESCRIPTION '$@#(c) Chris Wohlgemuth :0.1 (12.05.02) (PMDB033.DLL)#@##1## 12.05.2002 18:17:00      Mon ;-)  ::::1::@@DLL Ressource'
    26 PROTMODE
    27 CODE LOADONCALL DISCARDABLE
    28 DATA SINGLE SHARED DISCARDABLE
     26DATA MULTIPLE NONSHARED
    2927EXPORTS
    30         queryLanguage
     28      queryLanguage = _queryLanguage
  • branches/v2.9_Lars/mediafolder/c/cddb/res/pmcddb034.DEF

    r90 r91  
    1818; */
    1919
    20 LIBRARY PMDB034 INITGLOBAL
     20LIBRARY PMDB034 INITINSTANCE TERMINSTANCE
    2121DESCRIPTION '$@#ž Chris Wohlgemuth :0.1 (12.05.02) (PMDB034.DLL)#@##1## 12.05.2002 18:17:00      Mi ;-)  ::::1::@@DLL de recursos'
    22 PROTMODE
    23 CODE LOADONCALL DISCARDABLE
    24 DATA SINGLE SHARED DISCARDABLE
     22DATA MULTIPLE NONSHARED
    2523EXPORTS 
    26         queryLanguage
     24      queryLanguage = _queryLanguage
    2725
  • branches/v2.9_Lars/mediafolder/c/cddb/res/pmcddb034.c

    r90 r91  
    1717 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    1818 */
    19 /*
    20  * French translation....: Guillaume Gay <guillaume[dot]gay[arobase]gmail[dot]com>
    21  * Version...............: 2020-07-22
    22  */
    2319
    2420#include <os2.h>
     
    2622PSZ queryLanguage()
    2723{
    28   return "Fran‡ais (033)";
     24  return "Espagnol (034)";
    2925}
  • branches/v2.9_Lars/mediafolder/c/helper/cddbhelper.cpp

    r57 r91  
    3838 */
    3939
    40 void extern printError(char* errorString)
     40void printError(char* errorString)
    4141{
    4242    char buffer[CCHMAXPATH] = {0};
     
    5555}
    5656
    57 void extern printErrorCR(char* errorString)
     57void printErrorCR(char* errorString)
    5858{
    5959  fprintf(stderr,"%s\n",errorString);
     
    6363
    6464
    65 void extern printData(char* outString)
     65void printData(char* outString)
    6666{
    6767  int fileHandle;
    6868  int rc;
    6969
    70   /* The name cddbDataFile is defined in the main pmcddb.cpp file. It is 
     70  /* The name cddbDataFile is defined in the main pmcddb.cpp file. It is
    7171     the discid (this is the native format of the data hold by a cddb server) */
    7272  fileHandle=open(cddbDataFile,O_APPEND|O_TEXT|O_WRONLY|O_CREAT,S_IWRITE);
Note: See TracChangeset for help on using the changeset viewer.