static void envinit(void) { char *display; char *atree; char *apath; if (_display != (char *)(0)) { display = bnstring("DISPLAY=", _display, (char *)(0)); putenv(display); } if ((atree = getenv("ATREE")) == (char *)(0)) { atree = bnstring("ATREE=", _defaultATREE, (char *)(0)); putenv(atree); atree = getenv("ATREE"); } if ((apath = getenv("APATH")) == (char *)(0)) { apath = bnstring("APATH=.:", atree, "/acore",(char *)(0)); putenv(apath); } return; }
static void startupSyslog(C* version) { C *s=bnstring("<A+ ",version,">",0); struct passwd *pwd; uid_t uid=getuid(); openlog(s,LOG_PID,LOG_LOCAL1); if ((pwd = getpwuid(uid)) && pwd->pw_name) syslog(LOG_INFO, pwd->pw_name); else syslog(LOG_INFO, "user == %d",uid); closelog();bfree(s); }
void ipcInstall(void) { CX saveCx=Cx; Cx=cx("i"); install((PFI)ipcRoster, "roster", A_, 0, 0, 0, 0, 0, 0, 0,0,0); install((PFI)ipcListenNPP, "listenNPP",IV, 4, A_, A_, IV, A_, 0, 0,0,0); install((PFI)ipcListenN, "listenN", IV, 2, A_, A_, 0, 0, 0, 0,0,0); install((PFI)ipcListenNP, "listenNP", IV, 3, A_, A_, A_, 0, 0, 0,0,0); install((PFI)ipcConnectNHPP,"connectNHPP",IV, 5, A_, A_, A_, IV, A_, 0,0,0); install((PFI)ipcConnectN, "connectN", IV, 2, A_, A_, 0, 0, 0, 0,0,0); install((PFI)ipcConnectNP, "connectNP",IV, 3, A_, A_, A_, 0, 0, 0,0,0); install((PFI)ipcTimer, "timer", IV, 2, A_, A_, 0, 0, 0, 0,0,0); install((PFI)ipcOpen, "open", IV, 1, IV, 0, 0, 0, 0, 0,0,0); install((PFI)ipcOpenSync, "openSync", IV, 2, IV, IV, 0, 0, 0, 0,0,0); install((PFI)ipcSend, "send", IV, 2, IV, A_, 0, 0, 0, 0,0,0); install((PFI)ipcSyncSend, "syncsend", A_, 3, IV, A_, A_, 0, 0, 0,0,0); install((PFI)ipcSyncRead, "syncread", A_, 2, IV, A_, 0, 0, 0, 0,0,0); install((PFI)ipcGetTimeout, "timeout", A_, 1, A_, 0, 0, 0, 0, 0,0,0); install((PFI)ipcSetDebug, "setdebug", IV, 2, IV, A_, 0, 0, 0, 0,0,0); install((PFI)ipcDebug, "debug", IV, 1, IV, 0, 0, 0, 0, 0,0,0); install((PFI)ipcDestroy, "destroy", IV, 1, IV, 0, 0, 0, 0, 0,0,0); install((PFI)ipcClose, "close", IV, 1, IV, 0, 0, 0, 0, 0,0,0); install((PFI)ipcAttrlists, "attrs", A_, 1, IV, 0, 0, 0, 0, 0,0,0); install((PFI)ipcSetAttr, "setattr", IV, 3, IV, A_, A_, 0, 0, 0,0,0); install((PFI)ipcGetAttr, "getattr", A_, 2, IV, A_, 0, 0, 0, 0,0,0); install((PFI)ipcWhatis, "whatis", A_, 1, IV, 0, 0, 0, 0, 0,0,0); Cx=saveCx; { char *atree; char *ipcfile; if ((atree = getenv("ATREE")) == (char *)(0)) { atree = "/usr/local/a+"; } ipcfile = bnstring(atree, "/lib/idap.+", (char *)(0)); loadafile(ipcfile,0); bfree(ipcfile); } }