diff --git a/mozilla/cck/cckwiz/ConfigEditor/JS.cpp b/mozilla/cck/cckwiz/ConfigEditor/JS.cpp new file mode 100644 index 00000000000..93baa157df5 --- /dev/null +++ b/mozilla/cck/cckwiz/ConfigEditor/JS.cpp @@ -0,0 +1,165 @@ +#include +#include +#include +#include +#include +#include +#include +//#include + + +typedef struct +{ + int width; + int height; +} DIMENSION; + +typedef struct +{ + char name[50]; + char value[50]; + char type[20]; + DIMENSION size; + POINT location; + char options[20]; +} widget; + +widget ptr_ga[1000]; + +int isnum(char valuestring[50]); + +int isnum(char valuestring[50]) +{ + //cout << "this is the value string " << valuestring << "\n"; + for (int i=0; i < (strlen(valuestring)); i++) + { if(!isdigit(valuestring[i])) + {//cout << "this is the string char " <> ptr_ga[i].name >> ptr_ga[i].value ; +// cout << ptr_ga[i].name <<","<< ptr_ga[i].value <<"\n"; + + i++; + +} + +myin.close(); +if(!myout) { + cout << "cannot open the file \n"; + return 1; +} + +if (argc == 1) +{ + + char prefer [7]; + char prefname[50]; + char pref1[5]; + char pref2[7]; + char bool1[5]; + char bool2[6]; + +if(!prefin) { + cout << "cannot open the file \n"; + return 1; +} + + +while (!prefin.eof()) { + + prefin >> prefer >> prefname ; +// cout <<"This is "<< prefer << " and " << prefname << "\n"; + i++; + + + + strcpy(pref1, "pref"); + strcpy(pref2, "config"); + strcpy(bool1, "true"); + strcpy(bool2, "false"); + + if (strcmp(prefer,pref1) ==0) + { +// cout << "inside the def pref \n"; + if (GetGlobal(prefname)!= NULL) + { if (( strcmp (GetGlobal(prefname), bool1) == 0)|| ( strcmp (GetGlobal(prefname), bool2)== 0) || (isnum (GetGlobal(prefname)))) + { //cout << "the current value is " < +#include +#include +#include +#include +#include +#include +//#include + + +typedef struct +{ + int width; + int height; +} DIMENSION; + +typedef struct +{ + char name[50]; + char value[50]; + char type[20]; + DIMENSION size; + POINT location; + char options[20]; +} widget; + +widget ptr_ga[1000]; + +int isnum(char valuestring[50]); + +int isnum(char valuestring[50]) +{ + //cout << "this is the value string " << valuestring << "\n"; + for (int i=0; i < (strlen(valuestring)); i++) + { if(!isdigit(valuestring[i])) + {//cout << "this is the string char " <> ptr_ga[i].name >> ptr_ga[i].value ; +// cout << ptr_ga[i].name <<","<< ptr_ga[i].value <<"\n"; + + i++; + +} + +myin.close(); +if(!myout) { + cout << "cannot open the file \n"; + return 1; +} + +if (argc == 1) +{ + + char prefer [7]; + char prefname[50]; + char pref1[5]; + char pref2[7]; + char bool1[5]; + char bool2[6]; + +if(!prefin) { + cout << "cannot open the file \n"; + return 1; +} + + +while (!prefin.eof()) { + + prefin >> prefer >> prefname ; +// cout <<"This is "<< prefer << "and " << prefname << "\n"; + i++; + + + + strcpy(pref1, "pref"); + strcpy(pref2, "config"); + strcpy(bool1, "true"); + strcpy(bool2, "false"); + + if (strcmp(prefer,pref1) ==0) + { +// cout << "inside the def pref \n"; + if (GetGlobal(prefname)!= NULL) + { if (( strcmp (GetGlobal(prefname), bool1) == 0)|| ( strcmp (GetGlobal(prefname), bool2)== 0) || (isnum (GetGlobal(prefname)))) + { //cout << "the current value is " <