MEM(3ast) MEM(3ast)

# [NAME](#NAME)

mem - fixed string routines

# [SYNOPSIS](#SYNOPSIS)

```
#include <ast.h>
void    mematoe(void* out, const void* in, size_t n);
void*   memdup(const void* buf, size_t n)
void    memetoa(void* out, const void* in, size_t n);
void*   memzero(void* buf, size_t n);
```

# [DESCRIPTION](#DESCRIPTION)

mematoe converts *n* ASCII characters in *in* to EBCDIC characters in *out*. *in* and *out* may be the same.

memdup copies the *n* byte buffer *buf* to a new location provided by [*malloc*(3)](/man/os/ksh/malloc.3) and returns a pointer to the new copy. 0 is returned if [*malloc*(3)](/man/os/ksh/malloc.3) fails.

memetoa converts *n* EBCDIC characters in *in* to ASCII characters in *out*. *in* and *out* may be the same.

memzero sets the first *n* bytes in *buf* to *0*.

# [SEE ALSO](#SEE_ALSO)

Proposed Bell Laboratories ASCII/EBCDIC standard, April 16, 1979.  
[str(3)](/man/os/ksh/str.3), [malloc(3)](/man/os/ksh/malloc.3)

---

Document: mem(3ast) from ksh 1.0.10-r36 (Chainguard OS)
Source: https://github.com/ksh93/ksh
