test-ctype.c File Reference
#include <stdio.h>
#include <locale.h>
#include <ctype.h>
Include dependency graph for test-ctype.c:
Go to the source code of this file.
Function Documentation
◆ describe_char()
void describe_char
(
int
c )
Definition at line 43 of file test-ctype.c.
44{
48
49 if (!isprint(cp))
50 cp = ' ';
51 if (!isprint(up))
52 up = ' ';
53 if (!isprint(lo))
54 lo = ' ';
55
56 printf(
"chr#%-4d%2c%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%4c%4c\n",
c, cp,
flag(isalnum(
c)),
flag(isalpha(
c)),
flag(iscntrl(
c)),
flag(isdigit(
c)),
flag(islower(
c)),
flag(isgraph(
c)),
flag(isprint(
c)),
flag(ispunct(
c)),
flag(isspace(
c)),
flag(isupper(
c)),
flag(isxdigit(
c)), lo, up);
57}
References flag(), and printf.
Referenced by main().
◆ flag()
Definition at line 33 of file test-ctype.c.
34{
35#ifdef LONG_FLAG
36 return b ?
"yes" :
"no";
37#else
39#endif
40}
References b.
Referenced by _hash_initbuf(), _intbig_alloc(), BootstrapModeMain(), describe_char(), FindWord(), getCompoundAffixFlagValue(), getopt_long(), gettoken_query(), ghstore_alloc(), gtrgm_alloc(), gtsvector_alloc(), hypothetical_rank_common(), IsAffixFlagInUse(), make_text_key(), makeitem(), makepol(), newfstate(), NIAddAffix(), NIAddSpell(), NIImportAffixes(), NIImportDictionary(), NormalizeSubWord(), parse_ooaffentry(), pgaio_io_set_flag(), pqConnectDBComplete(), process_postgres_switches(), pushquery(), pushval_asis(), spg_box_quad_inner_consistent(), spg_box_quad_leaf_consistent(), and test_atomic_flag().
◆ main()
Definition at line 60 of file test-ctype.c.
61{
63 char *cur_locale;
64
66 if (cur_locale)
67 fprintf(stderr,
"Successfully set locale to \"%s\"\n", cur_locale);
68 else
69 {
70 fprintf(stderr,
"Cannot setup locale. Either your libc does not provide\nlocale support, or your locale data is corrupt, or you have not set\nLANG or LC_CTYPE environment variable to proper value. Program aborted.\n");
71 return 1;
72 }
73
74 printf(
"char# char alnum alpha cntrl digit lower graph print punct space upper xdigit lo up\n");
75 for (
c = 0;
c <= 255;
c++)
77
78 return 0;
79}
#define fprintf(file, fmt, msg)
void describe_char(int c)
References describe_char(), fprintf, printf, and setlocale.