X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/554a2f77f485f55c8c62ae9d854a2198b2c0f98f..ba979553b6c71b733d294ca7b3f461c9080e7f72:/stglibs/common.lib/include/stg/common.h diff --git a/stglibs/common.lib/include/stg/common.h b/stglibs/common.lib/include/stg/common.h index ddc69def..e90ad75a 100644 --- a/stglibs/common.lib/include/stg/common.h +++ b/stglibs/common.lib/include/stg/common.h @@ -27,16 +27,15 @@ #ifndef common_h #define common_h -#ifdef __BORLANDC__ -#include -#else -#include -#endif +#include "stg/os_int.h" +#include "stg/const.h" + #include #include +#include -#include "stg/os_int.h" -#include "stg/const.h" +#include // uid_t, gid_t +#include // mode_t #define STAT_TIME_3 (1) #define STAT_TIME_2 (2) @@ -168,11 +167,11 @@ int str2x(const std::string & str, varT & x); template const std::string & x2str(varT x, std::string & s); template -const std::string & x2str(varT x) { std::string s; return x2str(x, s); } +std::string x2str(varT x) { std::string s; return x2str(x, s); } template const std::string & unsigned2str(varT x, std::string & s); template -const std::string & unsigned2str(varT x) { std::string s; return unsigned2str(x, s); } +std::string unsigned2str(varT x) { std::string s; return unsigned2str(x, s); } //----------------------------------------------------------------------------- template @@ -299,4 +298,8 @@ const std::string & unsigned2str(varT x, std::string & s) char * stg_strptime(const char *, const char *, struct tm *); time_t stg_timegm(struct tm *); +uid_t str2uid(const std::string& name); +gid_t str2gid(const std::string& name); +mode_t str2mode(const std::string& mode); + #endif