Home | History | Annotate | Download | only in Oniguruma
      1 #ifndef ONIGGNU_H
      2 #define ONIGGNU_H
      3 /**********************************************************************
      4   oniggnu.h - Oniguruma (regular expression library)
      5 **********************************************************************/
      6 /*-
      7  * Copyright (c) 2002-2005  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>
      8  * All rights reserved.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  *
     19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29  * SUCH DAMAGE.
     30  */
     31 
     32 #include "oniguruma.h"
     33 
     34 #ifdef __cplusplus
     35 extern "C" {
     36 #endif
     37 
     38 #define RE_MBCTYPE_ASCII         0
     39 #define RE_MBCTYPE_EUC           1
     40 #define RE_MBCTYPE_SJIS          2
     41 #define RE_MBCTYPE_UTF8          3
     42 
     43 /* GNU regex options */
     44 #ifndef RE_NREGS
     45 #define RE_NREGS                ONIG_NREGION
     46 #endif
     47 
     48 #define RE_OPTION_IGNORECASE         ONIG_OPTION_IGNORECASE
     49 #define RE_OPTION_EXTENDED           ONIG_OPTION_EXTEND
     50 #define RE_OPTION_MULTILINE          ONIG_OPTION_MULTILINE
     51 #define RE_OPTION_SINGLELINE         ONIG_OPTION_SINGLELINE
     52 #define RE_OPTION_LONGEST            ONIG_OPTION_FIND_LONGEST
     53 #define RE_OPTION_POSIXLINE         (RE_OPTION_MULTILINE|RE_OPTION_SINGLELINE)
     54 #define RE_OPTION_FIND_NOT_EMPTY     ONIG_OPTION_FIND_NOT_EMPTY
     55 #define RE_OPTION_NEGATE_SINGLELINE  ONIG_OPTION_NEGATE_SINGLELINE
     56 #define RE_OPTION_DONT_CAPTURE_GROUP ONIG_OPTION_DONT_CAPTURE_GROUP
     57 #define RE_OPTION_CAPTURE_GROUP      ONIG_OPTION_CAPTURE_GROUP
     58 
     59 
     60 ONIG_EXTERN
     61 void re_mbcinit P_((int));
     62 ONIG_EXTERN
     63 int re_compile_pattern P_((const char*, int, struct re_pattern_buffer*, char* err_buf));
     64 ONIG_EXTERN
     65 int re_recompile_pattern P_((const char*, int, struct re_pattern_buffer*, char* err_buf));
     66 ONIG_EXTERN
     67 void re_free_pattern P_((struct re_pattern_buffer*));
     68 ONIG_EXTERN
     69 int re_adjust_startpos P_((struct re_pattern_buffer*, const char*, int, int, int));
     70 ONIG_EXTERN
     71 int re_search P_((struct re_pattern_buffer*, const char*, int, int, int, struct re_registers*));
     72 ONIG_EXTERN
     73 int re_match P_((struct re_pattern_buffer*, const char *, int, int, struct re_registers*));
     74 ONIG_EXTERN
     75 void re_set_casetable P_((const char*));
     76 ONIG_EXTERN
     77 void re_free_registers P_((struct re_registers*));
     78 ONIG_EXTERN
     79 int re_alloc_pattern P_((struct re_pattern_buffer**));  /* added */
     80 
     81 #ifdef __cplusplus
     82 }
     83 #endif
     84 
     85 #endif /* ONIGGNU_H */
     86