X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/2e768e3cc0ce768373d3320eca4cdd08b8cf646a..8023f7eb111623d44bfa5c0b13961f8e901d252c:/uip/mhparam.c diff --git a/uip/mhparam.c b/uip/mhparam.c index c4b0af2e..a1ca28f7 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -12,11 +12,6 @@ #include -extern char *mhlibdir; -extern char *mhetcdir; - -char *sbackup = BACKUP_PREFIX; - #define MHPARAM_SWITCHES \ X("components", 0, COMPSW) \ X("nocomponents", 0, NCOMPSW) \ @@ -33,6 +28,25 @@ DEFINE_SWITCH_ENUM(MHPARAM); DEFINE_SWITCH_ARRAY(MHPARAM, switches); #undef X +extern char *mhlibdir; +extern char *mhetcdir; + +char *sbackup = BACKUP_PREFIX; + +char *lockmethod = +#if defined FCNTL_LOCKING + "fcntl" +#elif defined FLOCK_LOCKING + "flock" +#elif defined LOCKF_LOCKING + "lockf" +#elif defined DOT_LOCKING + "dot" +#else + "none" +#endif + ; + struct proc { char *p_name; char **p_field; @@ -65,6 +79,7 @@ static struct proc procs [] = { { "etcdir", &mhetcdir }, { "libdir", &mhlibdir }, { "sbackup", &sbackup }, + { "lockmethod", &lockmethod }, { NULL, NULL }, }; @@ -186,7 +201,7 @@ p_find(char *str) struct proc *ps; for (ps = procs; ps->p_name; ps++) - if (!mh_strcasecmp (ps->p_name, str)) + if (!strcasecmp (ps->p_name, str ? str : "")) return (*ps->p_field); return NULL;