Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
|
Go to the documentation of this file.
36 static char s_cPeriod = 46;
53 int iStriCmp(
const char* cpLeft,
const char* cpRight){
54 if(cpLeft == NULL && cpRight == NULL){
63 size_t uiLeftLen = strlen(cpLeft);
64 size_t uiRightLen = strlen(cpRight);
65 size_t uiLen = uiLeftLen < uiRightLen ? uiLeftLen : uiRightLen;
67 unsigned char ucL, ucR;
68 for(; ui < uiLen; ui++){
71 if(ucL >= 65 && ucL <= 90){
74 if(ucR >= 65 && ucR <= 90){
84 if(uiLeftLen < uiRightLen){
87 if(uiLeftLen > uiRightLen){
100 } sIsBig = {0x01020304};
101 return (
abool)(sIsBig.caChar[0] == 1);
111 if(luiL == 0 || luiR == 0){
115 luint luiTest = luiL * luiR;
116 luint luiCheck = luiTest / luiR;
117 if(luiCheck != luiL){
132 luint uiTest = uiL + uiR;
136 luint uiCheck = uiTest - uiR;
151 if(uiL == 0 || uiR == 0){
155 uint32_t uiTest = uiL * uiR;
156 uint32_t uiCheck = uiTest / uiR;
171 uint32_t uiTest = uiL + uiR;
175 uint32_t uiCheck = uiTest - uiR;
190 if(uiL == 0 || uiR == 0){
194 aint uiTest = uiL * uiR;
195 aint uiCheck = uiTest / uiR;
210 aint uiTest = uiL + uiR;
214 aint uiCheck = uiTest - uiR;
238 if(!spPhrase || !cpStr){
241 aint uiStrLen = strlen(cpStr);
243 aint uiLen = uiStrLen < uiBufLen ? uiStrLen : uiBufLen;
246 for(; ui < uiLen; ui++){
248 acpTmp[ui] = (
achar)((uint8_t)cpStr[ui]);
267 for(; ui < spPhrase->
uiLength; ui++){
269 if(acChar == 9 || acChar == 10 || acChar == 13 || (acChar >= 32 && acChar <= 126)){
270 cpStr[ui] = (char)acChar;
272 cpStr[ui] = s_cPeriod;
293 for(; ui < spPhrase->
uiLength; ui++){
295 if(!(acChar == 9 || acChar == 10 || acChar == 13 || (acChar >= 32 && acChar <= 126))){
314 aint uiStrLen = strlen(cpStr);
316 for(; ui < uiStrLen; ui++){
317 uipBuf[ui] = (uint32_t)((uint8_t)cpStr[ui]);
339 for(; ui < uiLen; ui++){
341 if(uiChar == 9 || uiChar == 10 || uiChar == 13 || (uiChar >= 32 && uiChar <= 126)){
342 cpStr[ui] = (char)uiChar;
344 cpStr[ui] = s_cPeriod;
362 aint uiStrLen = strlen(cpStr);
364 for(; ui < uiStrLen; ui++){
365 uipBuf[ui] = (uint32_t)((uint8_t)cpStr[ui]);
385 for(; ui < spPhrase->
uiLength; ui++){
387 if(uiChar == 9 || uiChar == 10 || uiChar == 13 || (uiChar >= 32 && uiChar <= 126)){
388 cpStr[ui] = (char)uiChar;
390 cpStr[ui] = s_cPeriod;
408 for(; ui < spPhrase->
uiLength; ui++){
410 if(!(uiChar == 9 || uiChar == 10 || uiChar == 13 || (uiChar >= 32 && uiChar <= 126))){
This header "#include"s all publid lib headers and other standard headers needed by most objects.
uint32_t uiLength
The number of integers in the array.
uint_fast8_t achar
achar is the type for the parser's alphabet characters.
const uint32_t * uipPhrase
Pointer to an array of 32-bit unsigned integers.
uint_fast32_t aint
The APG parser's unsigned integer type.
Defines a pointer to an achar array plus its length. That is, a phrase as is often used by APG.
uintmax_t luint
luint is used to cast integers suitable for the %"PRIuMAX" printf format.
aint uiLength
The number of characters in the array.
uint8_t abool
abool is the APG bool type.
Defines a pointer to an array of 32-bit unsigned integers plus its length. Typically needed by Unicod...
const achar * acpPhrase
Pointer to an array of type achar APG alphabet characters.
APG Version 7.0 is licensed under the
2-Clause BSD License,
an Open Source Initiative Approved License.