diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-03-08 14:14:49 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-03-08 14:14:49 +0000 |
commit | 35d67dd80aa3ba72b75683cb1f35c81066e21223 (patch) | |
tree | 946248a3dfaf9710586856ba20e82a0a661b2a61 /source3/param | |
parent | f3eeb2f1fa528b0d952d2519f719d30f4a2489fa (diff) | |
download | samba-35d67dd80aa3ba72b75683cb1f35c81066e21223.tar.gz samba-35d67dd80aa3ba72b75683cb1f35c81066e21223.tar.bz2 samba-35d67dd80aa3ba72b75683cb1f35c81066e21223.zip |
Jeremy is going to hate me ...
These are some hacks on SWAT. Maybe users will actually be able to
work out how to use it now.
Unfortunately these changes required some editing in loadparm.c and
smb.h which will make Jeremys merge job harder. Sorry!
(This used to be commit 674c88a6bf4c8009769a482c53f105efdc54bbc8)
Diffstat (limited to 'source3/param')
-rw-r--r-- | source3/param/loadparm.c | 512 |
1 files changed, 216 insertions, 296 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c0f54860c1..39f6de0e1e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -89,18 +89,6 @@ extern pstring myname; #define LP_SNUM_OK(iService) (((iService) >= 0) && ((iService) < iNumServices) && iSERVICE(iService).valid) #define VALID(i) iSERVICE(i).valid -/* these are the types of parameter we have */ -typedef enum -{ - P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL, - P_STRING,P_USTRING,P_GSTRING,P_UGSTRING,P_ENUM -} parm_type; - -typedef enum -{ - P_LOCAL,P_GLOBAL,P_NONE -} parm_class; - int keepalive=0; extern BOOL use_getwd_cache; @@ -402,11 +390,6 @@ static BOOL handle_coding_system(char *pszParmValue,char **ptr); static void set_default_server_announce_type(void); -struct enum_list { - int value; - char *name; -}; - static struct enum_list enum_protocol[] = {{PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, {PROTOCOL_LANMAN1, "LANMAN1"}, {PROTOCOL_CORE,"CORE"}, {PROTOCOL_COREPLUS, "COREPLUS"}, @@ -427,221 +410,213 @@ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "uppe static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; -static struct parm_struct -{ - char *label; - parm_type type; - parm_class class; - void *ptr; - BOOL (*special)(); - struct enum_list *enum_list; -} parm_table[] = +static struct parm_struct parm_table[] = { - {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL}, - {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL}, - {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL}, - {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL}, - {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol}, - {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security}, - {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL}, - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL}, - {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as}, - {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL}, - {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL}, - {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL}, - {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL}, - {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL}, - {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL}, - {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL}, - {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL}, - {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL}, - {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL}, - {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL}, - {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL}, - {"networkstation user login", P_BOOL,P_GLOBAL, &Globals.bNetWkstaUserLogon,NULL, NULL}, - {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL}, - {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL, NULL}, - {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL}, - {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL}, - {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL}, - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL}, - {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL}, - {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL}, - {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL}, - {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL}, - {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL}, - {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL}, - {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL}, - {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL}, - {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL}, - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL}, - {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL}, - {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL}, - {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL}, - {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL}, - {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL}, + {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, + {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, 0}, + {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, + {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, + {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, + {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, + {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, + {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, + {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, + {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL, 0}, + {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, + {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, + {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, + {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, + {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, 0}, + {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, + {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, + {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, + {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL, 0}, + {"networkstation user login", P_BOOL,P_GLOBAL, &Globals.bNetWkstaUserLogon,NULL, NULL, 0}, + {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, + {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, + {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL, NULL, FLAG_BASIC}, + {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, + {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, + {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, 0}, + {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, + {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC}, + {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, + {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, + {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, + {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, + {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, #ifdef NTDOMAIN - {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL}, - {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL}, - {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL}, - {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL, NULL}, - {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL}, - {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL}, - {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL}, - {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL}, - {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL}, - {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL}, + {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL, 0}, + {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL, 0}, + {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, + {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL, NULL, 0}, + {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, + {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, + {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, + {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, + {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, + {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, #endif /* NTDOMAIN */ - {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL}, - {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL}, - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL}, - {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL}, - {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL}, - {"remote browse sync",P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync,NULL, NULL}, - {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL}, - {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL}, - {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL}, - {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL}, - {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL}, - {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL}, - {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL}, - {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL}, - {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL}, - {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL}, - {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL}, - {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL}, - {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL}, - {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL}, - {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL}, - {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL}, - {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL}, - {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL, NULL}, - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL}, - {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL}, - {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL}, - {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL}, - {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce}, - {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL}, - {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL}, - {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL}, - {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL}, - {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL}, - {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL}, - {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL}, - {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL}, - {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL}, - {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL}, - {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL}, - {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL}, - {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL}, - {"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy, NULL}, - {"include", P_STRING, P_LOCAL, &sDefault.szInclude, handle_include, NULL}, - {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL}, - {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL}, - {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL}, - {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL}, - {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL}, - {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL}, - {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL}, - {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case}, - {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL}, - {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL}, - {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL}, - {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL, NULL}, - {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL}, - {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL}, - {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL}, - {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL}, - {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL}, - {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL}, - {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL}, - {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL}, - {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL}, - {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL}, - {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL}, - {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL}, - {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL}, - {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL}, - {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL}, - {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL}, - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, - {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, - {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, - {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, - {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL}, - {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL}, - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL}, - {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL}, - {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL}, - {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL}, - {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL}, - {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL}, - {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL}, - {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL}, - {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL}, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL}, - {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL, NULL}, - {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL}, - {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL}, - {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL}, - {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL}, - {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL}, - {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL}, - {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL}, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL}, - {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL}, - {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL}, - {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL}, - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL}, - {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL}, - {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL}, - {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL}, - {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL}, - {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing}, - {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL}, - {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL}, - {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL}, - {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL}, - {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL}, - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL}, - {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL}, - {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL}, - {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL}, - {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL}, - {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL}, - {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL}, - {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL}, - {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL}, - {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL}, - {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL}, - {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL}, - {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL}, - - {NULL, P_BOOL, P_NONE, NULL, NULL, NULL} + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, + {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, + {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, 0}, + {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, + {"remote browse sync",P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync,NULL, NULL, 0}, + {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, + {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, + {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, + {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, + {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, + {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, + {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, + {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, + {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, + {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, + {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, + {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, + {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, + {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL, 0}, + {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, + {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL, NULL, 0}, + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, 0}, + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, + {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, + {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, + {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce, 0}, + {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, + {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, + {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL, FLAG_BASIC}, + {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, + {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, 0}, + {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL, 0}, + {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, + {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, + {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL, 0}, + {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, + {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL, 0}, + {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL, FLAG_HIDE}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy, NULL, FLAG_HIDE}, + {"include", P_STRING, P_LOCAL, &sDefault.szInclude, handle_include, NULL, FLAG_HIDE}, + {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, + {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, + {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, 0}, + {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, 0}, + {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, 0}, + {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, 0}, + {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, 0}, + {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, 0}, + {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, + {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, + {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, 0}, + {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL, NULL, 0}, + {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, 0}, + {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, 0}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, 0}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, + {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, 0}, + {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, 0}, + {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, 0}, + {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, 0}, + {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, 0}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, 0}, + {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, 0}, + {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC}, + {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, 0}, + {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, 0}, + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, 0}, + {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, 0}, + {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, 0}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, 0}, + {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, 0}, + {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, 0}, + {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, 0}, + {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, 0}, + {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, 0}, + {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, 0}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, 0}, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, 0}, + {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL, NULL, 0}, + {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, + {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, 0}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, 0}, + {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, 0}, + {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, 0}, + {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, 0}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, 0}, + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, 0}, + {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, 0}, + {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, 0}, + {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, 0}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, 0}, + {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, 0}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, + {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT}, + {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT}, + {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT}, + {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT}, + {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, 0}, + {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL, 0}, + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, + {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, 0}, + {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, 0}, + {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, + {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, + {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, 0}, + {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, 0}, + {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, 0}, + {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, 0}, + {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, 0}, + {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, 0}, + {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, 0}, + + {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1664,6 +1639,15 @@ static void init_copymap(service *pservice) /*************************************************************************** + return the local pointer to a parameter given the service number and the + pointer into the default structure +***************************************************************************/ +void *lp_local_ptr(int snum, void *ptr) +{ + return (void *)(((char *)pSERVICE(snum)) + PTR_DIFF(ptr,&sDefault)); +} + +/*************************************************************************** Process a parameter for a particular service number. If snum < 0 then assume we are in the globals ***************************************************************************/ @@ -1831,59 +1815,6 @@ static void print_parameter(struct parm_struct *p,void *ptr, FILE *f) /*************************************************************************** -print a parameter of the specified type -***************************************************************************/ -static void parameter_string(struct parm_struct *p,void *ptr,char *s) -{ - int i; - s[0] = 0; - - switch (p->type) { - case P_ENUM: - for (i=0;p->enum_list[i].name;i++) { - if (*(int *)ptr == p->enum_list[i].value) { - sprintf(s,"%s",p->enum_list[i].name); - break; - } - } - break; - - case P_BOOL: - sprintf(s, "%s",BOOLSTR(*(BOOL *)ptr)); - break; - - case P_BOOLREV: - sprintf(s, "%s",BOOLSTR(! *(BOOL *)ptr)); - break; - - case P_INTEGER: - sprintf(s, "%d",*(int *)ptr); - break; - - case P_CHAR: - sprintf(s, "%c",*(char *)ptr); - break; - - case P_OCTAL: - sprintf(s, "0%o",*(int *)ptr); - break; - - case P_GSTRING: - case P_UGSTRING: - if ((char *)ptr) - sprintf(s, "%s",(char *)ptr); - break; - - case P_STRING: - case P_USTRING: - if (*(char **)ptr) - sprintf(s, "%s",*(char **)ptr); - break; - } -} - - -/*************************************************************************** check if two parameters are equal ***************************************************************************/ static BOOL equal_parameter(parm_type type,void *ptr1,void *ptr2) @@ -2030,8 +1961,7 @@ serice and snum==-2 gives the globals return 0 when out of parameters ***************************************************************************/ -int lp_next_parameter(int snum, int *i, char *label, - char *value, int allparameters) +struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) { if (snum == -2) { /* do the globals */ @@ -2041,12 +1971,7 @@ int lp_next_parameter(int snum, int *i, char *label, (*parm_table[*i].label != '-') && ((*i) == 0 || (parm_table[*i].ptr != parm_table[(*i)-1].ptr))) { - strcpy(label, parm_table[*i].label); - parameter_string(&parm_table[*i], - parm_table[*i].ptr, - value); - (*i)++; - return 1; + return &parm_table[(*i)++]; } return 0; } else { @@ -2064,12 +1989,7 @@ int lp_next_parameter(int snum, int *i, char *label, !equal_parameter(parm_table[*i].type, ((char *)pService) + pdiff, ((char *)&sDefault) + pdiff)) { - strcpy(label, parm_table[*i].label); - parameter_string(&parm_table[*i], - ((char *)pService) + pdiff, - value); - (*i)++; - return 1; + return &parm_table[(*i)++]; } } } |