xref: /original-bsd/usr.bin/m4/TEST/string.m4 (revision 3b6250d9)
1#
2# Copyright (c) 1989 The Regents of the University of California.
3# All rights reserved.
4#
5# This code is derived from software contributed to Berkeley by
6# Ozan Yigit.
7#
8# %sccs.include.redist.sh%
9#
10#	@(#)string.m4	5.2 (Berkeley) 04/12/91
11#
12
13define(string,`integer $1(len(substr($2,1)))
14str($1,substr($2,1),0)
15data $1(len(substr($2,1)))/EOS/
16')
17
18define(str,`ifelse($2,",,data $1(incr($3))/`LET'substr($2,0,1)/
19`str($1,substr($2,1),incr($3))')')
20