2N/A/* $OpenLDAP: pkg/ldap/libraries/liblunicode/ure/ure.h,v 1.15 2008/01/07 23:20:05 kurt Exp $ */
2N/A/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
2N/A *
2N/A * Copyright 1998-2008 The OpenLDAP Foundation.
2N/A * All rights reserved.
2N/A *
2N/A * Redistribution and use in source and binary forms, with or without
2N/A * modification, are permitted only as authorized by the OpenLDAP
2N/A * Public License.
2N/A *
2N/A * A copy of this license is available in file LICENSE in the
2N/A * top-level directory of the distribution or, alternatively, at
2N/A * <http://www.OpenLDAP.org/license.html>.
2N/A */
2N/A/* Copyright 1997, 1998, 1999 Computing Research Labs,
2N/A * New Mexico State University
2N/A *
2N/A * Permission is hereby granted, free of charge, to any person obtaining a
2N/A * copy of this software and associated documentation files (the "Software"),
2N/A * to deal in the Software without restriction, including without limitation
2N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
2N/A * and/or sell copies of the Software, and to permit persons to whom the
2N/A * Software is furnished to do so, subject to the following conditions:
2N/A *
2N/A * The above copyright notice and this permission notice shall be included in
2N/A * all copies or substantial portions of the Software.
2N/A *
2N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
2N/A * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
2N/A * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
2N/A * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
2N/A * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2N/A */
2N/A/* $Id: ure.h,v 1.2 1999/09/21 15:47:44 mleisher Exp $ */
2N/A
2N/A#ifndef _h_ure
2N/A#define _h_ure
2N/A
2N/A#include "k5-int.h"
2N/A
2N/A#include <stdio.h>
2N/A
2N/A/*
2N/A * Set of character class flags.
2N/A */
2N/A#define _URE_NONSPACING 0x00000001
2N/A#define _URE_COMBINING 0x00000002
2N/A#define _URE_NUMDIGIT 0x00000004
2N/A#define _URE_NUMOTHER 0x00000008
2N/A#define _URE_SPACESEP 0x00000010
2N/A#define _URE_LINESEP 0x00000020
2N/A#define _URE_PARASEP 0x00000040
2N/A#define _URE_CNTRL 0x00000080
2N/A#define _URE_PUA 0x00000100
2N/A
2N/A#define _URE_UPPER 0x00000200
2N/A#define _URE_LOWER 0x00000400
2N/A#define _URE_TITLE 0x00000800
2N/A#define _URE_MODIFIER 0x00001000
2N/A#define _URE_OTHERLETTER 0x00002000
2N/A#define _URE_DASHPUNCT 0x00004000
2N/A#define _URE_OPENPUNCT 0x00008000
2N/A#define _URE_CLOSEPUNCT 0x00010000
2N/A#define _URE_OTHERPUNCT 0x00020000
2N/A#define _URE_MATHSYM 0x00040000
2N/A#define _URE_CURRENCYSYM 0x00080000
2N/A#define _URE_OTHERSYM 0x00100000
2N/A
2N/A#define _URE_LTR 0x00200000
2N/A#define _URE_RTL 0x00400000
2N/A
2N/A#define _URE_EURONUM 0x00800000
2N/A#define _URE_EURONUMSEP 0x01000000
2N/A#define _URE_EURONUMTERM 0x02000000
2N/A#define _URE_ARABNUM 0x04000000
2N/A#define _URE_COMMONSEP 0x08000000
2N/A
2N/A#define _URE_BLOCKSEP 0x10000000
2N/A#define _URE_SEGMENTSEP 0x20000000
2N/A
2N/A#define _URE_WHITESPACE 0x40000000
2N/A#define _URE_OTHERNEUT 0x80000000
2N/A
2N/A/*
2N/A * Error codes.
2N/A */
2N/A#define _URE_OK 0
2N/A#define _URE_UNEXPECTED_EOS -1
2N/A#define _URE_CCLASS_OPEN -2
2N/A#define _URE_UNBALANCED_GROUP -3
2N/A#define _URE_INVALID_PROPERTY -4
2N/A
2N/A/*
2N/A * Options that can be combined for searching.
2N/A */
2N/A#define URE_IGNORE_NONSPACING 0x01
2N/A#define URE_DOT_MATCHES_SEPARATORS 0x02
2N/A
2N/Atypedef krb5_ui_4 ucs4_t;
2N/Atypedef krb5_ui_2 ucs2_t;
2N/A
2N/A/*
2N/A * Opaque type for memory used when compiling expressions.
2N/A */
2N/Atypedef struct _ure_buffer_t *ure_buffer_t;
2N/A
2N/A/*
2N/A * Opaque type for the minimal DFA used when matching.
2N/A */
2N/Atypedef struct _ure_dfa_t *ure_dfa_t;
2N/A
2N/A/*************************************************************************
2N/A *
2N/A * API.
2N/A *
2N/A *************************************************************************/
2N/A
2N/Aure_buffer_t ure_buffer_create (void);
2N/A
2N/Avoid ure_buffer_free (ure_buffer_t buf);
2N/A
2N/Aure_dfa_t
2N/Aure_compile (ucs2_t *re, unsigned long relen,
2N/A int casefold, ure_buffer_t buf);
2N/A
2N/Avoid ure_dfa_free (ure_dfa_t dfa);
2N/A
2N/Avoid ure_write_dfa (ure_dfa_t dfa, FILE *out);
2N/A
2N/Aint
2N/Aure_exec (ure_dfa_t dfa, int flags, ucs2_t *text,
2N/A unsigned long textlen, unsigned long *match_start,
2N/A unsigned long *match_end);
2N/A
2N/A/*************************************************************************
2N/A *
2N/A * Prototypes for stub functions used for URE. These need to be rewritten to
2N/A * use the Unicode support available on the system.
2N/A *
2N/A *************************************************************************/
2N/A
2N/Aucs4_t _ure_tolower (ucs4_t c);
2N/A
2N/Aint
2N/A_ure_matches_properties (unsigned long props, ucs4_t c);
2N/A
2N/A#endif /* _h_ure */