瀏覽代碼

Add casecmp source information

Jeremy Soller 3 年之前
父節點
當前提交
3f12d8917c
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/header/wctype/casecmp.rs

+ 8 - 0
src/header/wctype/casecmp.rs

@@ -1,4 +1,9 @@
+// From musl src/ctype/casemap.h
+// Licensed under the MIT license
+// Copyright 2005-2020 Rich Felker, et al.
+
 use crate::platform::types::*;
+
 const tab: [c_uchar; 2666] = [
     7, 8, 9, 10, 11, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 13, 6, 6, 14, 6, 6, 6, 6, 6, 6, 6, 6, 15,
     16, 17, 18, 6, 19, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 20, 21, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
@@ -100,6 +105,7 @@ const tab: [c_uchar; 2666] = [
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 ];
+
 const rules: [c_int; 240] = [
     0x0, 0x2001, -0x2000, 0x1dbf00, 0x2e700, 0x7900, 0x2402, 0x101, -0x100, 0x0, 0x201, -0x200,
     -0xc6ff, -0xe800, -0x78ff, -0x12c00, 0xc300, 0xd201, 0xce01, 0xcd01, 0x4f01, 0xca01, 0xcb01,
@@ -125,6 +131,7 @@ const rules: [c_int; 240] = [
     -0x2000, 0x0, 0x2801, -0x2800, 0x0, 0x4001, -0x4000, 0x0, 0x2001, -0x2000, 0x0, 0x2001,
     -0x2000, 0x0, 0x2201, -0x2200,
 ];
+
 const rulebases: [c_uchar; 512] = [
     0, 6, 39, 81, 111, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0,
     131, 142, 146, 151, 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 196, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -144,6 +151,7 @@ const rulebases: [c_uchar; 512] = [
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 ];
+
 const exceptions: [[c_uchar; 2]; 200] = [
     [48, 12],
     [49, 13],