X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/ac3670b33981698a02c5e95ab4f11cb3fe57562d..29e9a2de0b45893850bbf56ee38e7fd235a6df15:/projects/sgconf/common_sg.h diff --git a/projects/sgconf/common_sg.h b/projects/sgconf/common_sg.h new file mode 100644 index 00000000..a5cbffad --- /dev/null +++ b/projects/sgconf/common_sg.h @@ -0,0 +1,71 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * Author : Boris Mikhailenko + */ + + /* + $Author: faust $ + $Revision: 1.5 $ + $Date: 2009/06/08 10:02:28 $ + */ + + +#ifndef COMMON_SG_H +#define COMMON_SG_H + +#include + +#include "stg/servconf.h" +#include "request.h" + +void UsageConf(); +void UsageInfo(); + +char * ParseUser(char * usr); +char * ParsePassword(char * pass); +char * ParseAdminLogin(char * adm); +short int ParseServerPort(const char * p); +void ParseAnyString(const char * c, string * msg, const char * enc = "cp1251"); +int CheckLogin(const char * login); +void ConvertFromKOI8(const std::string & src, std::string * dst); +void ConvertToKOI8(const std::string & src, std::string * dst); + +int ProcessGetUser(const std::string &server, + int port, + const std::string &admLogin, + const std::string &admPasswd, + const std::string &login, + void * data); + +int ProcessAuthBy(const std::string &server, + int port, + const std::string &admLogin, + const std::string &admPasswd, + const std::string &login, + void * data); + +int ProcessSetUser(const std::string &server, + int port, + const std::string &admLogin, + const std::string &admPasswd, + const std::string &str, + void * data, + bool isMessage = false); + +#endif +