|
Packit Service |
8bf002 |
/* n_1.c: Conversion of trigraph sequences. */
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
#include "defs.h"
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
char quasi_trigraph[] = { '?', '?', ' ', '?', '?', '?', ' ', '?', '?', '%',
|
|
Packit Service |
8bf002 |
' ', '?', '?', '^', ' ', '?', '#', '\0' };
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
main( void)
|
|
Packit Service |
8bf002 |
{
|
|
Packit Service |
8bf002 |
int ab = 1, cd = 2;
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
fputs( "started\n", stderr);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 1.1: The following 9 sequences are valid trigraph sequences. */
|
|
Packit Service |
8bf002 |
assert( strcmp( "??( ??) ??/??/ ??' ??< ??> ??! ??- ??="
|
|
Packit Service |
8bf002 |
,"[ ] \\ ^ { } | ~ #") == 0);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 1.2: In directive line. */
|
|
Packit Service |
8bf002 |
??= define OR( a, b) a ??! b
|
|
Packit Service |
8bf002 |
assert( OR( ab, cd) == 3);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 1.3: Any sequence other than above 9 is not a trigraph sequence. */
|
|
Packit Service |
8bf002 |
assert( strcmp( "?? ??? ??% ??^ ???=", quasi_trigraph) == 0);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
fputs( "success\n", stderr);
|
|
Packit Service |
8bf002 |
return 0;
|
|
Packit Service |
8bf002 |
}
|
|
Packit Service |
8bf002 |
|