## Characters

### C Reference

C types

C character types

#### Type names

- `ecl_character`
- `character`
- `ecl_base_char`
- `base-char`

##### Description

&ECL; defines two C types to hold its characters: `ecl_base_char` and `ecl_character`.

- When &ECL; is built without Unicode, they both coincide and typically match `unsigned char`, to cover the 256 codes that are needed.

- When &ECL; is built with Unicode, the two types are no longer equivalent, with `ecl_character` being larger.

For your code to be portable and future proof, use both types to really express what you intend to do.

Constructors

Creating and extracting characters from Lisp objects

#### Functions and macros

    	  cl_object ECL_CODE_CHAR
    	  ecl_character code

    	  ecl_character ECL_CHAR_CODE
    	  cl_object o

    	  cl_object ecl_char_code
    	  ecl_character code

    	  ecl_base_char ecl_base_char_code
    	  cl_object o

##### Description

These functions and macros convert back and forth from C character types to Lisp. The macros `ECL_CHAR_CODE` and `ECL_CODE_CHAR` perform this coercion without checking the arguments. The functions `ecl_char_code` and `ecl_base_char_code`, on the other hand, verify that the argument has the right type and signal an error otherwise.

Predicates

C predicates for Lisp characters

#### Functions and macros

    	  bool ecl_base_char_p
    	  ecl_character c

    	  bool ecl_alpha_char_p
    	  ecl_character c

    	  bool ecl_alphanumeric_p
    	  ecl_character c

    	  bool ecl_graphic_char_p
    	  ecl_character c

    	  bool ecl_digit_p
    	  ecl_character c

    	  bool ecl_standard_char_p
    	  ecl_character c

##### Description

These functions are equivalent to their Lisp equivalents but return C booleans.

Character case

C functions related to the character case

#### Functions and macros

    	  bool ecl_upper_case_p
    	  ecl_character c

    	  bool ecl_lower_case_p
    	  ecl_character c

    	  bool ecl_both_case_p
    	  ecl_character c

    	  ecl_character ecl_char_downcase
    	  ecl_character c

    	  ecl_character ecl_char_upcase
    	  ecl_character c

##### Description

These functions check or change the case of a character. Note that in an Unicode context, the output of these functions might not be accurate (for instance when the uppercase character has two or more codepoints).

ANSI Dictionary

&ANSI-C-Dict;

- Lisp symbol
- C function
- char=
- `cl_object cl_charE(cl_narg narg, ...)`
- char/=
- `cl_object cl_charNE(cl_narg narg, ...)`
- char<
- `cl_object cl_charL(cl_narg narg, ...)`
- char>
- `cl_object cl_charG(cl_narg narg, ...)`
- char<=
- `cl_object cl_charLE(cl_narg narg, ...)`
- char>=
- `cl_object cl_charGE(cl_narg narg, ...)`
- char-equal
- `cl_object cl_char_equal(cl_narg narg, ...)`
- char-not-equal
- `cl_object cl_char_not_equal(cl_narg narg, ...)`
- char-lessp
- `cl_object cl_char_lessp(cl_narg narg, ...)`
- char-greaterp
- `cl_object cl_char_greaterp(cl_narg narg, ...)`
- char-not-greaterp
- `cl_object cl_char_not_greaterp(cl_narg narg, ...)`
- char-not-lessp
- `cl_object cl_char_not_lessp(cl_narg narg, ...)`
- character
- `cl_object cl_character(cl_object char_designator)`
- characterp
- `cl_object cl_characterp(cl_object object)`
- alpha-char-p
- `cl_object cl_alpha_char_p(cl_object character)`
- alphanumericp
- `cl_object cl_alphanumericp(cl_object character)`
- digit-char
- `cl_object cl_digit_char(cl_narg narg, cl_object character, ...)`
- digit-char-p
- `cl_object cl_digit_char_p(cl_narg narg, cl_object character, ...)`
- graphic-char-p
- `cl_object cl_graphic_char_p(cl_object character)`
- standard-char-p
- `cl_object cl_standard_char_p(cl_object character)`
- char_upcase
- `cl_object cl_char_upcase(cl_object character)`
- char-downcase
- `cl_object cl_char_downcase(cl_object character)`
- upper-case-p
- `cl_object cl_upper_case_p(cl_object character)`
- lower-case-p
- `cl_object cl_lower_case_p(cl_object character)`
- both-case-p
- `cl_object cl_both_case_p(cl_object character)`
- char-code
- `cl_object cl_char_code(cl_object character)`
- char-int
- `cl_object cl_char_int(cl_object character)`
- code-char
- `cl_object cl_code_char(cl_object code)`
- char-name
- `cl_object cl_char_name(cl_object character)`
- name-char
- `cl_object cl_name_char(cl_object name)`

##### Description