X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmArgMgr.cxx;h=172cb7d2ac191bc0cf278098fa3c764663921686;hb=0e88aff6bcac1c201b50acb285ba079f3a6b1a6c;hp=d54aae7c3e85f7f6b1f7edf43bb31804c07babdf;hpb=48f7ce7aa61778477992107caf15e8960359e66b;p=gdcm.git diff --git a/src/gdcmArgMgr.cxx b/src/gdcmArgMgr.cxx index d54aae7c..172cb7d2 100644 --- a/src/gdcmArgMgr.cxx +++ b/src/gdcmArgMgr.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmArgMgr.cxx,v $ Language: C++ - Date: $Date: 2006/01/26 15:52:56 $ - Version: $Revision: 1.17 $ + Date: $Date: 2006/01/26 18:34:13 $ + Version: $Revision: 1.20 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,6 +21,12 @@ #include #include // For strlen +// No strcasecmp in WIN32 world, but stricmp +// http://www.opengroup.org/onlinepubs/007908799/xsh/strcasecmp.html +#ifdef _WIN32 +#define strcasecmp stricmp +#endif + #include // For strtok and strlen #include // For strtol and strtod @@ -162,7 +168,7 @@ char *ArgMgr::ArgMgrValue ( const char *param ) * \brief Search for the first not yet used label * @return Pointer to the char array holding the first non used label */ -char *ArgMgr::ArgMgrUnused ( ) +const char *ArgMgr::ArgMgrUnused ( ) { int i ; for ( i=ArgCount-1; i>0; i-- ) @@ -182,7 +188,7 @@ char *ArgMgr::ArgMgrUnused ( ) */ int ArgMgr::ArgMgrPrintUnusedLabels () { - char *label; + const char *label; int i=0; while ( (label=ArgMgrUnused())!=0 ) { @@ -217,7 +223,7 @@ int ArgMgr::ArgMgrUsage(const char **usage ) * @param param char. array that defines the parameter * @return Entier correspondant au rang dans la liste de labels */ -int ArgMgr::ArgMgrSave ( char *param ) +int ArgMgr::ArgMgrSave ( const char *param ) { static int deja = 0; FILE *fd; @@ -295,7 +301,7 @@ const char *ArgMgr::ArgMgrGetString(const char *param, const char *defaultVal) * @param val number of default value * @return int : range of value amongst the values list */ -int ArgMgr::ArgMgrGetLabel (const char *param, char *liste, int val ) +int ArgMgr::ArgMgrGetLabel (const char *param, const char *liste, int val ) { char *lab; const char *vallab; @@ -327,6 +333,7 @@ int ArgMgr::ArgMgrGetLabel (const char *param, char *liste, int val ) * @param liste character Chain describing the various values. * Labels are separated by '\\'. * No case sensitive. + * WARNING this will be changed (not const) * @param usage Usage program (displayed if label not found) * @return int : range of value amongst the values list */ @@ -762,7 +769,7 @@ char *ArgMgr::Majuscule (const char *chaine ) * Valeur retournee . : false if OK. * * true if KO. * **************************************************************************/ -int ArgMgr::FiltreLong ( char *arg ) +int ArgMgr::FiltreLong ( const char *arg ) { int n = 0 ; while ( (n++