summaryrefslogtreecommitdiff
path: root/examples/quote.m4
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-05 11:10:13 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-05 11:10:13 -0800
commit7be93f2d05131d061bd4790ae33c8d50f50010d7 (patch)
tree72736c1606f803a92ffa07c9808ffea2521d009e /examples/quote.m4
downloadm4-7be93f2d05131d061bd4790ae33c8d50f50010d7.tar.gz
m4-7be93f2d05131d061bd4790ae33c8d50f50010d7.tar.bz2
m4-7be93f2d05131d061bd4790ae33c8d50f50010d7.zip
Imported Upstream version 1.4.16upstream/1.4.16
Diffstat (limited to 'examples/quote.m4')
-rw-r--r--examples/quote.m49
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/quote.m4 b/examples/quote.m4
new file mode 100644
index 0000000..fae52c3
--- /dev/null
+++ b/examples/quote.m4
@@ -0,0 +1,9 @@
+divert(`-1')
+# quote(args) - convert args to single-quoted string
+define(`quote', `ifelse(`$#', `0', `', ``$*'')')
+# dquote(args) - convert args to quoted list of quoted strings
+define(`dquote', ``$@'')
+# dquote_elt(args) - convert args to list of double-quoted strings
+define(`dquote_elt', `ifelse(`$#', `0', `', `$#', `1', ```$1''',
+ ```$1'',$0(shift($@))')')
+divert`'dnl