1.fp 5 CW
2.de Af
3.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
4.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
5..
6.de aF
7.ie \\$3 .ft \\$1
8.el \{\
9.ds ;G \&
10.nr ;G \\n(.f
11.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
12\\*(;G
13.ft \\n(;G \}
14..
15.de L
16.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
17..
18.de LR
19.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
20..
21.de RL
22.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
23..
24.de EX		\" start example
25.ta 1i 2i 3i 4i 5i 6i
26.PP
27.RS 
28.PD 0
29.ft 5
30.nf
31..
32.de EE		\" end example
33.fi
34.ft
35.PD
36.RE
37.PP
38..
39.TH MEM 3
40.SH NAME
41mem \- fixed string routines
42.SH SYNOPSIS
43.EX
44#include <ast.h>
45
46void    mematoe(void* \fIout\fP, const void* \fIin\fP, size_t \fIn\fP);
47void*   memdup(const void* \fIbuf\fP, size_t \fIn\fP)
48void    memetoa(void* \fIout\fP, const void* \fIin\fP, size_t \fIn\fP);
49void*   memzero(void* \fIbuf\fP, size_t \fIn\fP);
50.EE
51.SH DESCRIPTION
52.L mematoe
53converts
54.I n
55ASCII characters in
56.I in
57to EBCDIC characters in
58.IR out .
59.I in
60and
61.I out
62may be the same.
63.PP
64.L memdup
65copies the 
66.I n
67byte buffer
68.I buf
69to a new location provided by
70.IR malloc (3)
71and returns a pointer to the new copy.
720 is returned if
73.IR malloc (3)
74fails.
75.PP
76.L memetoa
77converts
78.I n
79EBCDIC characters in
80.I in
81to ASCII characters in
82.IR out .
83.I in
84and
85.I out
86may be the same.
87.PP
88.L memzero
89sets the first 
90.I n
91bytes in
92.I buf
93to 
94.IR 0 .
95.SH "SEE ALSO"
96Proposed Bell Laboratories ASCII/EBCDIC standard, April 16, 1979.
97.br
98str(3), vmalloc(3)
99