aboutsummaryrefslogtreecommitdiff
path: root/mflib
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-05-22 11:23:04 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-05-22 11:23:04 +0000
commit21aa7f59a42451fb51778200cf533f2685203ade (patch)
tree00d3bf1d9a7a1db442c4676d569a483b80b8fdd0 /mflib
parent3097cd14c6dd1ce742d0f05af974274576af9e51 (diff)
downloadmailfromd-21aa7f59a42451fb51778200cf533f2685203ade.tar.gz
mailfromd-21aa7f59a42451fb51778200cf533f2685203ade.tar.bz2
Discontinue supporting &code (specifying an exception code)
Implement $# and @parm, which expands to the ordinal number of a parameter: func foo(string x ; number y) do echo @y done gives 1. git-svn-id: file:///svnroot/mailfromd/trunk@1464 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'mflib')
-rw-r--r--mflib/dns.mf6
-rw-r--r--mflib/pp-setup5
-rw-r--r--mflib/safedb.mf9
3 files changed, 17 insertions, 3 deletions
diff --git a/mflib/dns.mf b/mflib/dns.mf
index 00dcdc58..da508fd9 100644
--- a/mflib/dns.mf
+++ b/mflib/dns.mf
@@ -31,10 +31,10 @@ do
do
return "0"
done
- if %domain == ""
- return primitive_resolve (%str)
- else
+ if $# > @domain
return primitive_resolve (%str, %domain)
+ else
+ return primitive_resolve (%str)
fi
done
diff --git a/mflib/pp-setup b/mflib/pp-setup
index 4a7eb10c..3749f7f6 100644
--- a/mflib/pp-setup
+++ b/mflib/pp-setup
@@ -104,4 +104,9 @@ m4_rename_m4(`undivert')
m4_rename_m4(`dnl')
m4_rename_m4(`__line__')
m4_rename_m4(`__file__')
+
+/* defined(X) -- Return true if the optional argument X is passed to
+ the function */
+m4_define(`defined',``$'#>@$1')
+
m4_divert(0)m4_dnl
diff --git a/mflib/safedb.mf b/mflib/safedb.mf
index 94b72797..5f311cb9 100644
--- a/mflib/safedb.mf
+++ b/mflib/safedb.mf
@@ -25,6 +25,12 @@ do
do
return ""
done
+ if $# <= @null
+ set null 0
+ if $# <= @defval
+ set defval ""
+ fi
+ fi
return dbget(%name, %key, %defval, %null)
done
@@ -34,6 +40,9 @@ do
do
return
done
+ if $# <= @null
+ set null 0
+ fi
dbput(%name, %key, %value, %null)
done

Return to:

Send suggestions and report system problems to the System administrator.