Changeset 67ca359 in mainline


Ignore:
Timestamp:
2019-02-02T17:05:56Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a5c78a18
Parents:
92244ed
Message:

Functions in <ctype.h> should be external

Standard says so.

Location:
uspace/lib/c
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/Makefile

    r92244ed r67ca359  
    5353        generic/context.c \
    5454        generic/corecfg.c \
     55        generic/ctype.c \
    5556        generic/devman.c \
    5657        generic/device/hw_res.c \
  • uspace/lib/c/include/ctype.h

    r92244ed r67ca359  
    2727 */
    2828
    29 /** @addtogroup libc
    30  * @{
    31  */
    32 /** @file
    33  */
    34 
    3529#ifndef LIBC_CTYPE_H_
    3630#define LIBC_CTYPE_H_
    3731
    38 static inline int islower(int c)
    39 {
    40         return ((c >= 'a') && (c <= 'z'));
    41 }
    42 
    43 static inline int isupper(int c)
    44 {
    45         return ((c >= 'A') && (c <= 'Z'));
    46 }
    47 
    48 static inline int isalpha(int c)
    49 {
    50         return (islower(c) || isupper(c));
    51 }
    52 
    53 static inline int isdigit(int c)
    54 {
    55         return ((c >= '0') && (c <= '9'));
    56 }
    57 
    58 static inline int isalnum(int c)
    59 {
    60         return (isalpha(c) || isdigit(c));
    61 }
    62 
    63 static inline int isblank(int c)
    64 {
    65         return c == ' ' || c == '\t';
    66 }
    67 
    68 static inline int iscntrl(int c)
    69 {
    70         return (c >= 0 && c < 0x20) || c == 0x7E;
    71 }
    72 
    73 static inline int isprint(int c)
    74 {
    75         return c >= 0 && c < 0x80 && !iscntrl(c);
    76 }
    77 
    78 static inline int isgraph(int c)
    79 {
    80         return isprint(c) && c != ' ';
    81 }
    82 
    83 static inline int isspace(int c)
    84 {
    85         switch (c) {
    86         case ' ':
    87         case '\n':
    88         case '\t':
    89         case '\f':
    90         case '\r':
    91         case '\v':
    92                 return 1;
    93                 break;
    94         default:
    95                 return 0;
    96         }
    97 }
    98 
    99 static inline int ispunct(int c)
    100 {
    101         return !isspace(c) && !isalnum(c) && isprint(c);
    102 }
    103 
    104 static inline int isxdigit(int c)
    105 {
    106         return isdigit(c) ||
    107             (c >= 'a' && c <= 'f') ||
    108             (c >= 'A' && c <= 'F');
    109 }
    110 
    111 static inline int tolower(int c)
    112 {
    113         if (isupper(c))
    114                 return (c + ('a' - 'A'));
    115         else
    116                 return c;
    117 }
    118 
    119 static inline int toupper(int c)
    120 {
    121         if (islower(c))
    122                 return (c + ('A' - 'a'));
    123         else
    124                 return c;
    125 }
     32int islower(int);
     33int isupper(int);
     34int isalpha(int);
     35int isdigit(int);
     36int isalnum(int);
     37int isblank(int);
     38int iscntrl(int);
     39int isprint(int);
     40int isgraph(int);
     41int isspace(int);
     42int ispunct(int);
     43int isxdigit(int);
     44int tolower(int);
     45int toupper(int);
    12646
    12747#endif
    128 
    129 /** @}
    130  */
Note: See TracChangeset for help on using the changeset viewer.