From eb4508dca5eba039cb347a55bfbef154c0e6a29d Mon Sep 17 00:00:00 2001 From: "varada%netscape.com" Date: Thu, 13 May 1999 22:42:50 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://10.0.0.236/trunk@31485 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/cck/cckwiz/ConfigEditor/JS.cpp | 165 ++++++++++++++++++ mozilla/cck/cckwiz/ConfigEditor/merge.cpp | 197 ++++++++++++++++++++++ 2 files changed, 362 insertions(+) create mode 100644 mozilla/cck/cckwiz/ConfigEditor/JS.cpp create mode 100644 mozilla/cck/cckwiz/ConfigEditor/merge.cpp 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 " <