|
| 1 | +package org.scalanative.bindgen.bindings.posix |
| 2 | + |
| 3 | +import scala.scalanative._ |
| 4 | +import scala.scalanative.native._ |
| 5 | + |
| 6 | +@native.extern |
| 7 | +object regex { |
| 8 | + type enum_reg_errcode_t = native.CUnsignedInt |
| 9 | + object enum_reg_errcode_t { |
| 10 | + final val REG_NOERROR: enum_reg_errcode_t = 0.toUInt |
| 11 | + final val REG_NOMATCH: enum_reg_errcode_t = 1.toUInt |
| 12 | + final val REG_BADPAT: enum_reg_errcode_t = 2.toUInt |
| 13 | + final val REG_ECOLLATE: enum_reg_errcode_t = 3.toUInt |
| 14 | + final val REG_ECTYPE: enum_reg_errcode_t = 4.toUInt |
| 15 | + final val REG_EESCAPE: enum_reg_errcode_t = 5.toUInt |
| 16 | + final val REG_ESUBREG: enum_reg_errcode_t = 6.toUInt |
| 17 | + final val REG_EBRACK: enum_reg_errcode_t = 7.toUInt |
| 18 | + final val REG_EPAREN: enum_reg_errcode_t = 8.toUInt |
| 19 | + final val REG_EBRACE: enum_reg_errcode_t = 9.toUInt |
| 20 | + final val REG_BADBR: enum_reg_errcode_t = 10.toUInt |
| 21 | + final val REG_ERANGE: enum_reg_errcode_t = 11.toUInt |
| 22 | + final val REG_ESPACE: enum_reg_errcode_t = 12.toUInt |
| 23 | + final val REG_BADRPT: enum_reg_errcode_t = 13.toUInt |
| 24 | + final val REG_EEND: enum_reg_errcode_t = 14.toUInt |
| 25 | + final val REG_ESIZE: enum_reg_errcode_t = 15.toUInt |
| 26 | + final val REG_ERPAREN: enum_reg_errcode_t = 16.toUInt |
| 27 | + } |
| 28 | + |
| 29 | + type s_reg_t = native.CLong |
| 30 | + type active_reg_t = native.CUnsignedLong |
| 31 | + type reg_syntax_t = native.CUnsignedLong |
| 32 | + type reg_errcode_t = enum_reg_errcode_t |
| 33 | + type struct_re_pattern_buffer = native.CArray[Byte, native.Nat.Digit[native.Nat._6, native.Nat._4]] |
| 34 | + type regex_t = struct_re_pattern_buffer |
| 35 | + type regoff_t = native.CInt |
| 36 | + type struct_regmatch_t = native.CStruct2[regoff_t, regoff_t] |
| 37 | + type regmatch_t = struct_regmatch_t |
| 38 | + val re_syntax_options: reg_syntax_t = native.extern |
| 39 | + def regcomp(__preg: native.Ptr[regex_t], __pattern: native.CString, __cflags: native.CInt): native.CInt = native.extern |
| 40 | + def regexec(__preg: native.Ptr[regex_t], __string: native.CString, __nmatch: native.CSize, __pmatch: native.Ptr[regmatch_t], __eflags: native.CInt): native.CInt = native.extern |
| 41 | + def regerror(__errcode: native.CInt, __preg: native.Ptr[regex_t], __errbuf: native.CString, __errbuf_size: native.CSize): native.CSize = native.extern |
| 42 | + def regfree(__preg: native.Ptr[regex_t]): Unit = native.extern |
| 43 | + |
| 44 | + object defines { |
| 45 | + val _REGEX_H: native.CInt = 1 |
| 46 | + val REG_EXTENDED: native.CInt = 1 |
| 47 | + val REG_NOTBOL: native.CInt = 1 |
| 48 | + } |
| 49 | + |
| 50 | + object implicits { |
| 51 | + implicit class struct_regmatch_t_ops(val p: native.Ptr[struct_regmatch_t]) extends AnyVal { |
| 52 | + def rm_so: regoff_t = !p._1 |
| 53 | + def rm_so_=(value: regoff_t): Unit = !p._1 = value |
| 54 | + def rm_eo: regoff_t = !p._2 |
| 55 | + def rm_eo_=(value: regoff_t): Unit = !p._2 = value |
| 56 | + } |
| 57 | + def struct_regmatch_t()(implicit z: native.Zone): native.Ptr[struct_regmatch_t] = native.alloc[struct_regmatch_t] |
| 58 | + } |
| 59 | +} |
0 commit comments