RUI3 (RAK Unified Interface 3) - RAK4631
ACharacter.h
Go to the documentation of this file.
1 
9 #ifndef __A_CHARACTER_H__
10 #define __A_CHARACTER_H__
11 
12 #include <ctype.h>
13 
45 inline boolean isAlphaNumeric(int thisChar) __attribute__((always_inline));
46 
74 inline boolean isAlpha(int thisChar) __attribute__((always_inline));
75 
104 inline boolean isAscii(int thisChar) __attribute__((always_inline));
105 
133 inline boolean isWhitespace(int thisChar) __attribute__((always_inline));
134 
162 inline boolean isControl(int thisChar) __attribute__((always_inline));
163 
191 inline boolean isDigit(int thisChar) __attribute__((always_inline));
192 
220 inline boolean isGraph(int thisChar) __attribute__((always_inline));
221 
249 inline boolean isLowerCase(int thisChar) __attribute__((always_inline));
250 
278 inline boolean isPrintable(int thisChar) __attribute__((always_inline));
279 
307 inline boolean isPunct(int thisChar) __attribute__((always_inline));
308 
337 inline boolean isSpace(int thisChar) __attribute__((always_inline));
338 
366 inline boolean isUpperCase(int thisChar) __attribute__((always_inline));
367 
395 inline boolean isHexadecimalDigit(int thisChar) __attribute__((always_inline));
398 inline int toAscii(int thisChar) __attribute__((always_inline));
399 inline int toLowerCase(int thisChar) __attribute__((always_inline));
400 inline int toUpperCase(int thisChar)__attribute__((always_inline));
401 
402 
403 // Checks for an alphanumeric character.
404 // It is equivalent to (isalpha(c) || isdigit(c)).
405 inline boolean isAlphaNumeric(int c) {
406  return ( isalnum(c) == 0 ? false : true); }
407 
408 
409 // Checks for an alphabetic character.
410 // It is equivalent to (isupper(c) || islower(c)).
411 inline boolean isAlpha(int c) {
412  return ( isalpha(c) == 0 ? false : true); }
413 
414 
415 // Checks whether c is a 7-bit unsigned char value
416 // that fits into the ASCII character set.
417 inline boolean isAscii(int c) {
418  return ( isascii (c) == 0 ? false : true); }
419 
420 
421 // Checks for a blank character, that is, a space or a tab.
422 inline boolean isWhitespace(int c) {
423  return ( isblank (c) == 0 ? false : true); }
424 
425 
426 // Checks for a control character.
427 inline boolean isControl(int c) {
428  return ( iscntrl (c) == 0 ? false : true); }
429 
430 
431 // Checks for a digit (0 through 9).
432 inline boolean isDigit(int c) {
433  return ( isdigit (c) == 0 ? false : true); }
434 
435 
436 // Checks for any printable character except space.
437 inline boolean isGraph(int c) {
438  return ( isgraph (c) == 0 ? false : true); }
439 
440 
441 // Checks for a lower-case character.
442 inline boolean isLowerCase(int c) {
443  return (islower (c) == 0 ? false : true); }
444 
445 
446 // Checks for any printable character including space.
447 inline boolean isPrintable(int c) {
448  return ( isprint (c) == 0 ? false : true); }
449 
450 
451 // Checks for any printable character which is not a space
452 // or an alphanumeric character.
453 inline boolean isPunct(int c) {
454  return ( ispunct (c) == 0 ? false : true); }
455 
456 
457 // Checks for white-space characters. For the avr-libc library,
458 // these are: space, formfeed ('\f'), newline ('\n'), carriage
459 // return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').
460 inline boolean isSpace(int c) {
461  return ( isspace (c) == 0 ? false : true); }
462 
463 
464 // Checks for an uppercase letter.
465 inline boolean isUpperCase(int c) {
466  return ( isupper (c) == 0 ? false : true); }
467 
468 
469 // Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7
470 // 8 9 a b c d e f A B C D E F.
471 inline boolean isHexadecimalDigit(int c) {
472  return ( isxdigit (c) == 0 ? false : true); }
473 
474 
475 // Converts c to a 7-bit unsigned char value that fits into the
476 inline int toAscii(int c) {
477  return toascii (c); }
478 
479 // Converts the letter c to lower case, if possible.
480 inline int toLowerCase(int c)
481 {
482  return tolower (c);
483 }
484 
485 
486 // Converts the letter c to upper case, if possible.
487 inline int toUpperCase(int c) {
488  return toupper (c); }
489 
490 #endif //end ACharacter.h
491 
boolean isAlpha(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:411
int toLowerCase(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:480
boolean isAscii(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:417
boolean isPunct(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:453
struct rak_proto_packet_header_ __attribute__((packed)) rak_proto_packet_header
boolean isDigit(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:432
boolean isUpperCase(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:465
boolean isPrintable(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:447
boolean isHexadecimalDigit(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:471
boolean isGraph(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:437
boolean isAlphaNumeric(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:405
boolean isWhitespace(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:422
boolean isLowerCase(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:442
boolean isControl(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:427
int toAscii(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:476
boolean isSpace(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:460
int toUpperCase(int thisChar) __attribute__((always_inline))
Definition: ACharacter.h:487