Welcome to mirror list, hosted at ThFree Co, Russian Federation.

toascii.c « ctype « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4506f355dcbffbb040087724bf2cf6b2b014c4ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
FUNCTION
	<<toascii>>---force integers to ASCII range

INDEX
	toascii

ANSI_SYNOPSIS
	#include <ctype.h>
	int toascii(int <[c]>);

TRAD_SYNOPSIS
	#include <ctype.h>
	int toascii(<[c]>);
	int (<[c]>);

DESCRIPTION
<<toascii>> is a macro which coerces integers to the ASCII range (0--127) by zeroing any higher-order bits.

You can use a compiled subroutine instead of the macro definition by
undefining this macro using `<<#undef toascii>>'.

RETURNS
<<toascii>> returns integers between 0 and 127.

PORTABILITY
<<toascii>> is not ANSI C.

No supporting OS subroutines are required.
*/

#include <_ansi.h>
#include <ctype.h>
#undef toascii

int
_DEFUN(toascii,(c),int c)
{
  return (c)&0177;
}