incubator-nuttx/include/wctype.h

109 lines
3.3 KiB
C

/****************************************************************************
* include/wctype.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __INCLUDE_WTYPE_H
#define __INCLUDE_WTYPE_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stddef.h>
#include <wchar.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef WEOF
# define WEOF ((wint_t)-1)
#endif
/* valid values for wctype_t */
#define WC_ALNUM 1
#define WC_ALPHA 2
#define WC_BLANK 3
#define WC_CNTRL 4
#define WC_DIGIT 5
#define WC_GRAPH 6
#define WC_LOWER 7
#define WC_PRINT 8
#define WC_PUNCT 9
#define WC_SPACE 10
#define WC_UPPER 11
#define WC_XDIGIT 12
/****************************************************************************
* Public Types
****************************************************************************/
/* A scalar type that can hold values which represent locale-specific
* character mappings.
*/
typedef int wctrans_t;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/* "The <wchar.h> header declares the following as functions and may also
* define them as macros. Function prototypes must be provided for use with
* an ISO C compiler."
*
* Reference: Opengroup.org
*/
int iswalnum(wint_t);
int iswalpha(wint_t);
int iswblank(wint_t);
int iswcntrl(wint_t);
int iswctype(wint_t, wctype_t);
int iswdigit(wint_t);
int iswgraph(wint_t);
int iswlower(wint_t);
int iswprint(wint_t);
int iswpunct(wint_t);
int iswspace(wint_t);
int iswupper(wint_t);
int iswxdigit(wint_t);
int towctrans(wint_t, wctrans_t);
wint_t towlower(wint_t);
wint_t towupper(wint_t);
wctrans_t wctrans(FAR const char *);
wctype_t wctype(FAR const char *);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* INCLUDE_WTYPE_H */