struct option long_options_get[] = {
{"server", 1, 0, 's'}, //Server
struct option long_options_get[] = {
{"server", 1, 0, 's'}, //Server
{"admin_pass", 1, 0, 'w'}, //passWord
{"user", 1, 0, 'u'}, //User
{"addcash", 0, 0, 'c'}, //Add Cash
{"admin_pass", 1, 0, 'w'}, //passWord
{"user", 1, 0, 'u'}, //User
{"addcash", 0, 0, 'c'}, //Add Cash
{"credit", 0, 0, 'r'}, //cRedit
{"tariff", 0, 0, 't'}, //Tariff
{"message", 0, 0, 'm'}, //message
{"credit", 0, 0, 'r'}, //cRedit
{"tariff", 0, 0, 't'}, //Tariff
{"message", 0, 0, 'm'}, //message
{"email", 1, 0, 'L'}, //emaiL
{"phone", 1, 0, 'P'}, //phone
{"group", 1, 0, 'G'}, //Group
{"email", 1, 0, 'L'}, //emaiL
{"phone", 1, 0, 'P'}, //phone
{"group", 1, 0, 'G'}, //Group
-{"ip", 0, 0, 'I'}, //IP-address of user
+{"ip", 0, 0, 'I'}, //IP-address of user
-#if defined(FREE_BSD) || defined(FREE_BSD5)
+char * ob = new char[strlen(c) + 1];
+char * ib = new char[strlen(c) + 1];
+
+strcpy(ib, c);
+
+char * outbuf = ob;
+char * inbuf = ib;
+
+size_t insize = strlen(c);
+size_t outsize = strlen(ib);
+
+#if defined(CONST_ICONV)
nconv = iconv (cd, (const char**)&inbuf, &insize, &outbuf, &outsize);
#else
nconv = iconv (cd, &inbuf, &insize, &outbuf, &outsize);
#endif
nconv = iconv (cd, (const char**)&inbuf, &insize, &outbuf, &outsize);
#else
nconv = iconv (cd, &inbuf, &insize, &outbuf, &outsize);
#endif
sprintf(str, "<Message login=\"%s\" msgver=\"1\" msgtype=\"1\" repeat=\"0\" repeatperiod=\"0\" showtime=\"0\" text=\"%s\"/>", req->login.const_data().c_str(), msg.c_str());
sprintf(str, "<Message login=\"%s\" msgver=\"1\" msgtype=\"1\" repeat=\"0\" repeatperiod=\"0\" showtime=\"0\" text=\"%s\"/>", req->login.const_data().c_str(), msg.c_str());
sprintf(str, "<cash add=\"%f\" msg=\"%s\"/>\n", req->cash.const_data(), msg.c_str());
strcat(r, str);
}
sprintf(str, "<cash add=\"%f\" msg=\"%s\"/>\n", req->cash.const_data(), msg.c_str());
strcat(r, str);
}
sprintf(str, "<cash set=\"%f\" msg=\"%s\"/>\n", req->setCash.const_data(), msg.c_str());
strcat(r, str);
}
sprintf(str, "<cash set=\"%f\" msg=\"%s\"/>\n", req->setCash.const_data(), msg.c_str());
strcat(r, str);
}
sprintf(str, "MU%d=\"%s\" ", i, ss.str().c_str());
strcat(r, str);
}
sprintf(str, "MU%d=\"%s\" ", i, ss.str().c_str());
strcat(r, str);
}
sprintf(str, "<userdata%d value=\"%s\"/>", i, ud.c_str());
strcat(r, str);
}
sprintf(str, "<userdata%d value=\"%s\"/>", i, ud.c_str());
strcat(r, str);
}
-
-//printf("a=%d, b=%d, u=%d, d=%d ud=%d\n", a, b, u, d, ud);
return a && (b || u || d || ud);
}
//-----------------------------------------------------------------------------
return a && (b || u || d || ud);
}
//-----------------------------------------------------------------------------
-int CheckParametersGet(REQUEST * req)
-{
-return CheckParameters(req);
-}
-//-----------------------------------------------------------------------------
-int CheckParametersSet(REQUEST * req)
-{
-return CheckParameters(req);
-}
-//-----------------------------------------------------------------------------
- c = getopt_long(argc, argv, short_options_get, long_options_get, &option_index);
+ int c = getopt_long(argc, argv, short_options_get, long_options_get, &option_index);
- return ProcessAuthBy(req.server.data(), req.port.data(), req.admLogin.data(), req.admPasswd.data(), req.login.data(), &req);
+ return ProcessAuthBy(req.server.const_data(), req.port.const_data(), req.admLogin.const_data(), req.admPasswd.const_data(), req.login.const_data(), &req);
- return ProcessGetUser(req.server.data(), req.port.data(), req.admLogin.data(), req.admPasswd.data(), req.login.data(), &req);
+ return ProcessGetUser(req.server.const_data(), req.port.const_data(), req.admLogin.const_data(), req.admPasswd.const_data(), req.login.const_data(), &req);
}
//-----------------------------------------------------------------------------
int mainSet(int argc, char **argv)
{
string str;
}
//-----------------------------------------------------------------------------
int mainSet(int argc, char **argv)
{
string str;
- c = getopt_long(argc, argv, short_options_set, long_options_set, &option_index);
+ int c = getopt_long(argc, argv, short_options_set, long_options_set, &option_index);
- ParseAnyString(optarg, &str);
- //printf("UD%d\n", c - 700);
+ ParseAnyString(optarg, &str, "koi8-ru");
-return ProcessSetUser(req.server.data(), req.port.data(), req.admLogin.data(), req.admPasswd.data(), rstr, NULL, isMessage);
+return ProcessSetUser(req.server.const_data(), req.port.const_data(), req.admLogin.const_data(), req.admPasswd.const_data(), rstr, NULL, isMessage);
}
//-----------------------------------------------------------------------------
int main(int argc, char **argv)
}
//-----------------------------------------------------------------------------
int main(int argc, char **argv)
return mainGet(argc - 1, argv + 1);
}
else if (strcmp(argv[1], "set") == 0)
return mainGet(argc - 1, argv + 1);
}
else if (strcmp(argv[1], "set") == 0)