File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #define STDC_RESTRICT __restrict
4+
5+ #ifdef __cplusplus
6+ # define STDC_BEGIN_HEADER extern "C" {
7+ # define STDC_END_HEADER }
8+ #else
9+ # define STDC_BEGIN_HEADER
10+ # define STDC_END_HEADER
11+ #endif
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #include <ctype.h>
2+ #include <stddef.h>
3+
4+ // using https://koor.fr/C/cctype/Index.wp for ascii code
5+
6+ int isalnum (int c ) {
7+ if (c <= 'z' && c >= 'a' ) {
8+ return 1 ;
9+ }
10+ if (c <= 'Z' && c >= 'A' ) {
11+ return 1 ;
12+ }
13+ if (c <= '9' && c >= '0' ) {
14+ return 1 ;
15+ }
16+ return 0 ;
17+ }
18+
19+ int isalpha (int c ) {
20+ if (c <= 'z' && c >= 'a' ) {
21+ return 1 ;
22+ }
23+ if (c <= 'Z' && c >= 'A' ) {
24+ return 1 ;
25+ }
26+ return 0 ;
27+ }
28+
29+ int isblank (int c ) {
30+ if (c == ' ' || c == '\t' ) {
31+ return 1 ;
32+ }
33+ return 0 ;
34+ }
35+
36+ int iscntrl (int c ) {
37+ if (c < 0x1f || c == 0x7f ) {
38+ return 1 ;
39+ }
40+ return 0 ;
41+ }
42+
43+ int isdigit (int c ) {
44+ if (c <= '9' && c >= '0' ) {
45+ return 1 ;
46+ }
47+ return 0 ;
48+ }
49+
50+ int isgraph (int c ) {
51+ if (c >= 0x21 && c <= 0x7f ) {
52+ return 1 ;
53+ }
54+ return 0 ;
55+ }
56+
57+ int islower (int c ) {
58+
59+ if (c >= 'a' && c <= 'z' ) {
60+ return 1 ;
61+ }
62+ return 0 ;
63+ }
64+
65+ int isprint (int c ) {
66+ if (c >= 0x20 && c <= 0x7f ) {
67+ return 1 ;
68+ }
69+ return 0 ;
70+ }
71+
72+ int ispunct (int c ) {
73+ char const punctuation [] = "!\"#$%&'()*+,-./:;<=>?@ [\\]^_`{|}~" ;
74+
75+ for (size_t i = 0 ; i < sizeof (punctuation ); i ++ ) {
76+ if (punctuation [i ] == c ) {
77+ return 1 ;
78+ }
79+ }
80+
81+ return 0 ;
82+ }
83+
84+ int isspace (int c ) {
85+ if (c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == '\v' ) {
86+ return 1 ;
87+ } else {
88+ return 0 ;
89+ }
90+ }
91+
92+ int isupper (int c ) {
93+ if (c >= 'A' && c <= 'Z' ) {
94+ return 1 ;
95+ }
96+ return 0 ;
97+ }
98+
99+ int isxdigit (int c ) {
100+ if (isdigit (c )) {
101+ return 1 ;
102+ }
103+ if (c <= 'F' && c >= 'A' ) {
104+ return 1 ;
105+ }
106+ if (c <= 'f' && c >= 'a' ) {
107+ return 1 ;
108+ }
109+ return 0 ;
110+ }
111+
112+ int tolower (int c ) {
113+ if (c >= 'A' && c <= 'Z' ) {
114+ c -= 'A' ;
115+ c += 'a' ;
116+ }
117+
118+ return c ;
119+ }
120+
121+ int toupper (int c ) {
122+ if (c >= 'a' && c <= 'z' ) {
123+ c -= 'a' ;
124+ c += 'A' ;
125+ }
126+ return c ;
127+ }
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include "_prelude.h"
4+
5+ STDC_BEGIN_HEADER
6+
7+ /* --- 7.4 Character - handling --------------------------------------------- */
8+
9+ /* --- 7.4.1 Character classification - Copying functions ------------------- */
10+
11+ int isalnum (int c );
12+
13+ int isalpha (int c );
14+
15+ int isblank (int c );
16+
17+ int iscntrl (int c );
18+
19+ int isdigit (int c );
20+
21+ int isgraph (int c );
22+
23+ int islower (int c );
24+
25+ int isprint (int c );
26+
27+ int ispunct (int c );
28+
29+ int isspace (int c );
30+
31+ int isupper (int c );
32+
33+ int isxdigit (int c );
34+
35+ int tolower (int c );
36+
37+ int toupper (int c );
38+
39+ STDC_END_HEADER
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include "_prelude.h"
4+
5+ STDC_BEGIN_HEADER
6+
7+ #define __LITTLE_ENDIAN 1234
8+ #define __BIG_ENDIAN 4321
9+ #define __BYTE_ORDER __LITTLE_ENDIAN
10+
11+ STDC_END_HEADER
Original file line number Diff line number Diff line change 1+ {
2+ "$schema" : " https://schemas.cute.engineering/stable/cutekit.manifest.component.v1" ,
3+ "id" : " ce-libc-host" ,
4+ "type" : " lib" ,
5+ "description" : " Placeholder for the host stdc library" ,
6+ "enableIf" : {
7+ "host" : [
8+ true
9+ ]
10+ },
11+ "provides" : [
12+ " stdc"
13+ ]
14+ }
Original file line number Diff line number Diff line change 11{
22 "$schema" : " https://schemas.cute.engineering/stable/cutekit.manifest.component.v1" ,
3- "id" : " ce-dummy " ,
3+ "id" : " ce-libc " ,
44 "type" : " lib" ,
5- "description" : " Cute Engineering Dummy Library " ,
5+ "description" : " The ISO C standard library, ISO/IEC 9899 " ,
66 "props" : {
77 "cpp-root-include" : true
8- }
8+ },
9+ "enableIf" : {
10+ "host" : [
11+ false
12+ ]
13+ },
14+ "provides" : [
15+ " stdc-ansi"
16+ ]
917}
Original file line number Diff line number Diff line change 1- # 👷 Cute Engineering Dummy Library
1+ # 👷 Cute Engineering Libc
22
3- A library to be used as a template for new libraries.
3+ The ISO C standard library, ISO/IEC 9899
You can’t perform that action at this time.
0 commit comments