1 #include <bglibs/systime.h> 2 #include <stdlib.h> 3 #include <bglibs/msg.h> 4 #include <bglibs/wrap.h> 5 #include "mailfront.h" 6 7 static const char* proto; 8 getprotoenv(const char * name)9const char* getprotoenv(const char* name) 10 { 11 static str fullname; 12 const char* env; 13 if (proto == 0) 14 if ((proto = getenv("PROTO")) == 0) 15 proto = "TCP"; 16 if (name == 0 || *name == 0) 17 return proto; 18 wrap_str(str_copy2s(&fullname, proto, name)); 19 if ((env = getenv(fullname.s)) != 0 20 && env[0] == 0) 21 env = 0; 22 return env; 23 } 24