PostgreSQL Source Code git master
Functions
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.

Functions

char *  flag (int b)
 
void  describe_char (int c)
 
int  main ()
 

Function Documentation

describe_char()

void describe_char ( int  c )

Definition at line 43 of file test-ctype.c.

44{
45 unsigned char cp = c,
46 up = toupper(c),
47 lo = tolower(c);
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}
#define printf(...)
Definition: port.h:245
c
char * c
Definition: preproc-cursor.c:31
char * flag(int b)
Definition: test-ctype.c:33

References flag(), and printf.

Referenced by main().

flag()

char * flag ( int  b )

Definition at line 33 of file test-ctype.c.

34{
35#ifdef LONG_FLAG
36 return b ? "yes" : "no";
37#else
38 return b ? "+" : " ";
39#endif
40}
b
int b
Definition: isn.c:74

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()

int main ( void  )

Definition at line 60 of file test-ctype.c.

61{
62 short c;
63 char *cur_locale;
64
65 cur_locale = setlocale(LC_ALL, "");
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)
Definition: cubescan.l:21
void describe_char(int c)
Definition: test-ctype.c:43
#define setlocale(a, b)
Definition: win32_port.h:475

References describe_char(), fprintf, printf, and setlocale.

AltStyle によって変換されたページ (->オリジナル) /